Create a backup with the MS-DOS XCOPY command

Experts Community Wiki

Tips, Tricks and knowledge from Windows experts

Create a backup with the MS-DOS XCOPY command

Experts Community Wiki

Let's suppose all your data is stored in the c: \data folder and you want to make regular backups of this folder to another drive. The usual technique is to open Windows Explorer and move the c: \data folder to a backup disk.

Another technique is much more efficient.
Open the Notepad and type the following command (this command saves the c: \data folder to the p:\backup folder. Of course, you have to adapt the first two parameters to your own configuration):

xcopy c: \data p: \backup /d /e /r /i /y

Save this file as backup.bat. Now, double-click the backup.bat icon to start your backup. The first time this batch file is launched, all files are saved. All subsequent times, only files that have changed are saved.
Sort by: Published Date | Most Recent | Most Useful
Comments
  • It should be noted that this isn't actually a backup.  It is simply a copy.  There are a few differences between a backup and a copy, the most notable difference being the copy method does not keep a history of file changes like a good backup program does.  That means each time the xcopy command is run, the resulting copy of the file is only the most recent version from the destination.  So if you need to revert to an older version, you can't.  With a good backup program, you could revert back to various versions of the file, depending on how many versions you had actually backed up.  Additionally, the above method only works for creating a copy of a personal documents folder.  Copying operating system files/folder will require additional xcopy switches to ensure all files are copied and attributes are maintained.  See technet.microsoft.com/.../bb491035.aspx for more information about the necessary switches.  Also, the restore process would require a similar xcopy command, which means you would need the computer booted and have full permission to write to the destination folder(s).  That means if you are trying to use this method to create a full copy of your entire system drive, you would need to create an emergency system restore media so you could boot and run the restore operation.  I'm not entirely certain this would actually work to restore a full system drive.

Page 1 of 1 (1 items)