1.

Solve : XCopy moves no files but debug claims it did?

Answer»

Greetings,

Long time reader, the site and forums has tons of info. Thanks for everything you have all contributed.

Below is a script I wrote to make a backup of a networked location onto my local. The script CREATES a file for today in a location, and then uses that dynamic location to backup the files to.

Code: [Select]@echo off
set today="%DATE:~10,4%-%date:~4,2%-%date:~7,2%\LeadResources"
echo %today%
md "C:\BACKUPS\%today%"
pause
xcopy "P:\XXXXX\XXXX\XXX\XXX" "C:\Backups\%today%" /L /S /I /-Y /EXCLUDE:C:\BatchF~1\Backup~1\LeadBa~1\BackupExclude.txt >> "C:\Batch Files\Temp\BackupResults.txt"
goto :end

The script successfully creates the dated folder and the nested LeadResources folder from the md command, but the xcopy does not move anything over.

Looking at the BackupResults.txt file shows lines such as this:

Code: [Select]...
P:\XXXXX\XXXX\XXX\XX\ZZZZ\ZZZ.xls
P:\XXXXX\XXXX\XXX\XX\ZZZZ\BBBxls
298 File(s)

This output leads me to believe that xcopy is successful in copying the files, but the files are not in the directory.

Any help that can be provided would be very much appreciated, I'm at a loss here.Remove the /L switch from the XCOPY. You have XCOPY RUNNING in WHATIF mode, which simply displays files that would be copied.

Good luck. Well that is just plain embarrassing. I was under my own assumption that /L would just output a list as well as copy them.

Thank you very much.



Discussion

No Comment Found