Saturday, 13 October 2012

xcopy command in Windows


Applications of Xcopy command.

Xcopy provides an excellent tool for backing up selected folders. With appropriate switches, a variety of backup scenarios can be created. One possible backup configuration would be to copy only those files that have been changed. Here is an example command: xcopy C:\somefolder

E:\backupfolder /D /E /C /R /H /I /K /Y This command will copy all files, including those in sub-folders, that are newer in the source folder. It will copy hidden as well as read-only files and will create the destination folder and/or sub-folders if they do not already exist.

Exit codes for Xcopy

The following table can be used for troubleshooting xcopy related issues.

Exit codeDescription
0Files were copied without error.
1No files were found to copy.
2The user pressed Ctrl+C to terminate xcopy.
4Various errors including insufficient memory or disk space, an invalid drive name, or invalid syntax.
5Disk write error occurred.

                                           

                                   Click Here to visit our facebook page and like.

1 comment: