Question : XCOPY for backup

Hi,
I use a Scheduled Task running a batch file to backup modified files with XCOPY. I am just now modifying the batch to use ERRORLEVEL to report on the general result of the  backup. This got me wondering if there is some way to capture the number of files that were copied by XCOPY to the backup drive, so the number can be reported. Of course if I run it manually from the command prompt the number of copied files is shown at the end of the XCOPY command. But is there a way to catch that, or otherwise obtain the number of copied files, so that the number can be used in the batch file?

Thanks,
Bill

Answer : XCOPY for backup

You can use for to capture the number
1:
for /f "tokens=1" %%a in ('xcopy c:\Folder1 e:\Backup /s ^| find "File(s)"') do ECHO XCOPY copied %%a files to e:\Backup
Open in New Window Select All
Random Solutions  
 
programming4us programming4us