Navigation

10/18/2012

xcopy command - backup


Trying to use XCOPY got "INVALID PATH" error.

xcopy "Q:\TECH SRV\"    /s /y

Just remove the final slash on the SOURCE directory:
xcopy "Q:\TECH SRV"    /s /y

good reference page on XCOPY 

On the destination, you do need the final slash, otherwise it askes is this a file name or directory name?

xcopy "Q:\ADMIN"   "E:\Q drive\ADMIN\" /s /y


I use the following to add date to folder name:

xcopy "Q:\ADMIN"   "E:\Backups- Q and W drives\20%date:~10,4%\Q drive - 20%date:~10,4%-%date:~4,2%-%date:~7,2%\ADMIN\" /s /y
20%date:~10,4%    year
%date:~4,2%       month

%date:~7,2%       day

No comments:

Post a Comment