Computing.Net > Forums > Programming > Xcopy script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Xcopy script

Reply to Message Icon

Name: jeomoma
Date: March 9, 2009 at 12:17:19 Pacific
OS: Windows xp
Subcategory: General
Comment:

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%



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: March 9, 2009 at 13:46:42 Pacific
Reply:

What's the question?


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

M2


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Xcopy script

I need a script. Kinda Urgent. www.computing.net/answers/programming/i-need-a-script-kinda-urgent/7448.html

script to find path and copy files www.computing.net/answers/programming/script-to-find-path-and-copy-files-/15276.html

vb script file www.computing.net/answers/programming/vb-script-file/14924.html