Xcopy script

March 9, 2009 at 12:17:19
Specs: Windows xp
Need to move file from one folder to another. The issue is on moving the file into destination folder with MMYYYY folder format(03-2009)

Set state= HUD
Set Month = 3
set year=2009

et filesource=\\pdx-file\Outbound\hud
set filedest=\\pdx-file\template\Properties\hud

echo ---------------Start-of-Record--------------- >> %logfile%

date /t >> %logfile%
time /t >> %logfile%

REM Copy over AP, CO, MS, PF, C, R, & VC .PDF files from property server to property folder on PDX-FILE

do XCOPY /S /I /Y "%filesource%\%%~A\*.pdf" "%filedest%\%state%\%%~A\Attachments\PayInvoice\%MM-year%\*.*" >> %logfile%


IF ERRORLEVEL 5 GOTO Problems
IF ERRORLEVEL 4 GOTO Problems
IF ERRORLEVEL 2 GOTO Cancel
IF ERRORLEVEL 1 GOTO NoFiles
IF ERRORLEVEL 0 GOTO OK

:Problems
ECHO Possible error. >> %logfile%
ECHO Modified/New files have not been backed up. >> %logfile%
GOTO end

:Cancel
ECHO Copying process terminated. >> %logfile%
GOTO end

:NoFiles
ECHO No files found to copy. >> %logfile%
GOTO end

:OK

Echo Move files to Backup folder

XCOPY /S /I /Y "%filesource%\*.pdf" "%backupsource%\*.*" >> %logfile%


See More: Xcopy script

Report •


#1
March 9, 2009 at 13:46:42
What's the question?


=====================================
If at first you don't succeed, you're about average.

M2


Report •
Related Solutions


Ask Question