mudcow007
asked on
Batch file to move files on network using unc
Hello all
im trying to use a batch file to copy files from off a list an insert them into another folder all within the network.
i have this
for /f "delims=" %%i in (filelist.txt) do echo F|xcopy "\\server1\data1\Images\%% i" "\\server2\data2\Images\%% i" /i /z /y
when i run this batch i get an error that reads
CMD.EXE was started with the above path as current directory
UNC paths are not supported. Defaulting to windows directory
any ideas??
thanks
im trying to use a batch file to copy files from off a list an insert them into another folder all within the network.
i have this
for /f "delims=" %%i in (filelist.txt) do echo F|xcopy "\\server1\data1\Images\%%
when i run this batch i get an error that reads
CMD.EXE was started with the above path as current directory
UNC paths are not supported. Defaulting to windows directory
any ideas??
thanks
The error itself can be ignored; what's causing problems is that the script expects filelist.txt in the current folder, which isn't valid as UNC path. Try this:
cd /d C:\Windows
cls
for /f "usebackq delims=" %%i in ("%~dp0filelist.txt") do echo F|xcopy "\\server1\data1\Images\%%i" "\\server2\data2\Images\%%i" /i /z /y
is the file list in the same Directory?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i tried you version oBdA
but got the error "The system could not find the file filelist.txt.
the actual file list is in the same folder on the network as the bat file - if that makes sense
thanks!
but got the error "The system could not find the file filelist.txt.
the actual file list is in the same folder on the network as the bat file - if that makes sense
thanks!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cheers guys got it to work!
thanks
thanks
http://technet.microsoft.com/en-us/library/cc733145(v=ws.10).aspx