Command line tip #6 - Easy backups with Xcopy
The command line repertoire contains a powerful method for copying or making backups of a folder and all its sub-folders. For many home PC users who want a simple but versatile backup method, the command “xcopy” is ideal. I discuss “xcopy” in all its glory at another site but here is an example of how to back up “My Documents” and all its sub-folders. This particular version will only copy files that are newer, thus saving the wasted effort of recopying identical files. This command makes use of an environment variable so that it always backs up the “My Documents” folder for whoever is presently logged in. The example uses a folder “D:\backup” as the destination but you can choose your own. It should, however, be a folder on a separate drive, such as a thumb drive, external USB drive, or CD/DVD. Open a command prompt and enter:
xcopy "%userprofile%\My Documents" D:\backup /s/d/y/c
If desired, you can modify this command with one or more of the other switches discussed at my command-line site. For example, to suppress the listing of all the files being copied, add the switch /q. To copy hidden or system files, add /h.
Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.

Comments
No comments yet.
Sorry, the comment form is closed at this time.