I have this batch file to copy all file from one directory to another directory. The source and destination directory are write in a text file. So I have this:
BATCH FILE
for /f "delims=: tokens=2,3" %%j in (C:\temp\copy_list_test.txt) do ROBOCOPY.EXE %%j %%j\..\BACKUP *.* /R:2 /W:5 /log+:%%j\..\LOGS\GOLD2MES.log & ROBOCOPY.EXE %%j %%k *.* /R:2 /W:5 /MOV /log+:%%j\..\LOGS\GOLD2MES.log
and this is a copy_list_test.txt file
TC C2 #001 from instrument to C:\temp\GOLDS\IMPORT:C:\temp\MESSE\IMPORT
So when I try to run the script he create a new folder on "C:\Users\mcastrio\Desktop\C\" and not put file in C:\temp\MESSERVER
Where is my error?
Can we help me? Best reguards
As you are using colons as delimiters in the input file, the tokenizer sees
That is,
You can change your
tokens
clause totokens=2,*
to obtainBut remember the drive reference in
%%j
has been lost.