First I'll explain how to use XCOPY and its "more advanced brother": Robocopy. Then I'll write how to make a shortcut to backup files instantly. And finally, how to make a batch file (multiple copying "with a single click").
The task is: copy files from a working dir (songs...) to a backup dir on a separate hard drive, overwriting older files with the same name.
XCOPY is already included in WindowsXP (and earlier versions). So all you have to do is run it.
Here's the xcopy command for the task:
Code: Select all
xcopy d:\WorkingDir\songs\*.* e:\BackupDir\songs\ /s /e /d /y /v
/s = copies subdirs
/e = copies also empty subdirs
/d = copies all files that are newer than the destination files
/y = don't need to confirm overwriting of files
/v = verifies that the copy is identical to the original
(The complete list of parameters can be found here.)
Robocopy is similar to XCOPY but has some advanced features. It's not included in WindowsXP by default (it is in Vista, tho) so if you want to use it there you have to install it either with the Server 2003 Resource Kit Tools or by downloading the .zip file on this page (recommended). Just extract robocopy.exe to C:\Windows\System32.
To do the same task with Robocopy is a bit simpler, since the command is "smarter":
Code: Select all
robocopy d:\WorkingDir\songs e:\BackupDir\songs /e /zb
/zb = a copying procedure (an extra, not available in xcopy)
All the other parameters I used in xcopy are performed by default in Robocopy.
(The complete list of parameters can be found in the .doc file, included in robocopy.zip or here, for example.)
A small tip: if the name of the folder has space in the name (like My Folder) then you have to use quotes in the command. For example:
robocopy d:\my folder e:\backup is wrong and won't work.
robocopy "d:\my folder" e:\backup is the right way to do it.
How to launch either of these commands?
1. In "Run..." from the Start menu (or the command line in Total Commander)
2. With a shortcut (or a button in Total Commander's button bar)
3. With a GUI, like this one.
The 1st and 3rd ways are pretty straight forward, so I'll explain how to make a shortcut, which is also the quickest way to make frequent backups:
1. R-click on an 'empty space' in Windows (on the Desktop or inside a folder)
2. New -> Shortcut
3. Type the command and then the name for the shortcut
4. To change the icon R-click on the shortcut -> Properties -> Change Icon...
(In TC you R-click on the button bar -> Change -> Add... (lots of icons in shell32.dll))
How to make multiple backups at once - from and to different locations?
Open notepad and type all the commands you need, like:
Code: Select all
robocopy d:\WorkingDir\songs e:\BackupDir\songs /e /zb
robocopy d:\WorkingDir\samples e:\BackupDir\samples /e /zb
robocopy d:\pictures f:\backup\pictures /e /zb
EDIT: updated with some info on Robocopy and batch files...