xcopy - Log and xcopy skip to next.
Posted: 09 Jun 2011 08:43
Hi Guys!
I'm new to the forums and a complete novice at dos batch.
I have the following code here to log my xcopy scripts and run the xcopy
The assistance I require is that the current code only prints out the Source path when it's successful, however, it does not print out the unsucessful xcopies. I need a code so it prints out the unsucessful xcopy - source path.
Secondly, one of the many problems with programming is the string name. I'm currently copying files over to other folders and sometimes the file may have a extra space somewhere in the file name.
Currently all the existing file names for all the files I have are currently in a Excel Spreadsheet, however, they're probably not the exact name or there may be extra space somewhere. I need to adjust the xcopy so that it will go to the next xcopy if such situations exists, so i can proceed to the next xcopy
Your help is much appreciated!
Thank you!
I'm new to the forums and a complete novice at dos batch.
I have the following code here to log my xcopy scripts and run the xcopy
Code: Select all
@echo on
setlocal
set /a counter=0
xcopy1 >> copylog.txt && set /a counter+=1
xcopy2 >> copylog.txt && set /a counter+=1
if %errorlevel% equ 0 (echo success >> copylog.txt) else (echo failure >> copylog.txt)
echo.%counter% of xcopys were run successfully >> copylog.txt
echo. >>copylog.txt
The assistance I require is that the current code only prints out the Source path when it's successful, however, it does not print out the unsucessful xcopies. I need a code so it prints out the unsucessful xcopy - source path.
Secondly, one of the many problems with programming is the string name. I'm currently copying files over to other folders and sometimes the file may have a extra space somewhere in the file name.
Currently all the existing file names for all the files I have are currently in a Excel Spreadsheet, however, they're probably not the exact name or there may be extra space somewhere. I need to adjust the xcopy so that it will go to the next xcopy if such situations exists, so i can proceed to the next xcopy
Your help is much appreciated!
Thank you!