Computer Hope

Microsoft => Microsoft DOS => Topic started by: shcsbaker on January 21, 2016, 05:16:06 AM

Title: xcopy symblic links from to directories in a text file
Post by: shcsbaker on January 21, 2016, 05:16:06 AM
I've got a text file with the full path and I want to copy all the symbolic links from a source folder to each folder in the text file.  Text file is called subs.txt looks like this:
C:\data\2653\arc2015
C:\data\8893\arc2015

the real text file will have around 30 or so of these entries.  Here's what I've tried in several variations:

for /f %%i in (subs.txt) DO xcopy "C:\forms\!SLinks\*.*" "%%i" /b /y

nothing happens, no errors messages or anything.

Thanks
Kevin
Title: Re: xcopy symblic links from to directories in a text file
Post by: foxidrive on January 21, 2016, 05:47:37 AM
I've got a text file with the full path and I want to copy all the symbolic links from a source folder to each folder in the text file.  Text file is called subs.txt looks like this:
C:\data\2653\arc2015
C:\data\8893\arc2015

the real text file will have around 30 or so of these entries.  Here's what I've tried in several variations:

for /f %%i in (subs.txt) DO xcopy "C:\forms\!SLinks\*.*" "%%i" /b /y

Did you use a batch file or a command prompt?  How come you are using !slinks?  or is that a folder?

From http://superuser.com/questions/148099/windows-7-symlinks-how-do-i-copy-a-symlink-to-a-directory

Quote
use the following command from elevated command prompt:
xcopy /b /i <source symlink name> <destination symlink name> 
it will say that 0 File(s) copied but the symlink will appear in the destination.  This is tested under Windows 7 and Windows 8.x  but should work starting as of Vista