I get "File Creation Error" when I use xcopy to move a file to a path. This code works fine:
for /f "eol=: delims=" %%a in (D:\Scripts\filelist.txt) do (
for /f "eol=_ tokens=4 delims=-" %%b in ("%%a") do (
xcopy /I /K /Q /R /Y "E:\ReportOutput\IAP_ddz\%%a" "E:\ReportOutput\IAP_ddz\BySchool\%%b\test\" >> Output.txt
)
)
But when I make a simply change to the xcopy statement shown below, it gives a "File Creation Error - The system cannot find the path specified".
xcopy /I /K /Q /R /Y "E:\ReportOutput\IAP_ddz\%%a" "E:\ReportOutput\IAP_ddz\BySchool\%%b\test\" >> Output.txt.
I am using Windows Server 2008 R2 Standard & I run CMD as Administrator.