Batch script query

Soldato
Joined
23 Mar 2007
Posts
2,553
Location
Essex
Hi all

Just looking for a second eye on this little script i have wrote to transfer files from my htpc to my whs. I keep getting the error "Invalid drive specification" cant think why, im sure its something simple but my brain has gone dead :eek:

Any ideas guys?

Thanks a mill

@Echo OFF

ECHO. >> "D:\ServerFolders\AUTOBACKUP.LOG"

ECHO %DATE% %TIME% >> "D:\ServerFolders\AUTOBACKUP.LOG"

ECHO. >> "D:\ServerFolders\AUTOBACKUP.LOG"
ECHO ---------------- >> "D:\ServerFolders\AUTOBACKUP.LOG"
ECHO MY MOVIES BACKUP >> "D:\ServerFolders\AUTOBACKUP.LOG"
ECHO ---------------- >> "D:\ServerFolders\AUTOBACKUP.LOG"
ECHO. >> "D:\ServerFolders\AUTOBACKUP.LOG"
XCOPY "\\LIAM-MEDIA\Media Drive 1\My Movies" "D:\ServerFolders\My Movies" /S /D /Y >> "D:\ServerFolders\AUTOBACKUP.LOG"
XCOPY "\\LIAM-MEDIA\Media Drive 2\My Movies" "D:\ServerFolders\My Movies" /S /D /Y >> "D:\ServerFolders\AUTOBACKUP.LOG"

pause
 
just guessing but try it with mapped drive letters instead of UNC paths??

also, why are you overwriting files? isn't it better to skip them if they already exist?

i'd look at using robocopy with the /MIR (mirror) switch. it also has switches for logging/retrying/etc.
 
Thanks mate i think i will take a look at robocopy. With the /mir switch will that delete things from the destination drive that no longer exist in the source? Just worried if i delete something and run it by mistake i dont want it to mirror the path file and lose things

As for why im over writing, the main jist of the batch is just to update whatever has changed, it doesnt copy the files that all ready exsist everytime :)
 
Back
Top Bottom