How do you do this? Can it be done on an XP machine?
It can be done in any Windows environment.
A batch file is just a text file containing commands to run executable(s) automatically.
Here is a copy of the batch file that I made to automatically run a series of backups from my laptop and transfer those files over my network to a Seagate FreeAgent External HD attached to my desktop. All at the simple click of a mouse.
You can remove the network command on line 3 to run this same batch file if the backup drive is physically attached to the machine you are using. Robocopy protocols will not authenticate, so you have to use the net use command to establish a connection.
I wrote this batch file below using Windows Vista Robocopy protocols, which work quite well and are similar to XCopy. You can set it up for disk mirroring or just to simply copy any new files that you've added to the source directory to the destination directory on the backup drive.
For example you can see in the first command I'm using robocopy to copy directory with timestamps, including sub folders, maximum of 3 retries, wait time in second between retries, copy downloads folder on c: drive to downloads folder on g: drive excluding any *mp3 files in the process. The rest of the lines do the same thing with different directories using various file exclusions.
net use g: "\\Desktop\g"
robocopy /DCOPY:T /E /R:3 /w:15 C:\Users\0wner\Downloads G:\Downloads /XF *.mp3
robocopy /DCOPY:T /E /R:3 /w:15 C:\Users\0wner\Music G:\Music /XF *.jpeg *.jpg *.gif *.mpg *.avi
robocopy /DCOPY:T /E /R:3 /w:15 C:\Users\0wner\Pictures G:\Pictures /XF *.mp3 *.wav
robocopy /DCOPY:T /E /R:3 /w:15 C:\Users\0wner\Primary G:\ /XF *.mp3
To make a simple batch file to automate your copying to a physically connected backup drive, you could write something simple like this.
robocopy /DCOPY:T /E /R:3 /w:15 C:\Temp G:\Temp
The "G" is what ever the drive letter assignment is for your dedicated backup drive. Backing up all contents from source drive Temp folder to destination drive Temp folder. And there will be no file exclusions.
To create the batch file, open up a text editor like notepad. Put in the commands you wish to use. Save file with .bat extension. Right click on the saved .bat file and select Send to Desktop. It will put a shortcut on the desktop. You doubleclick that short cut and boom everything runs automatically, providing you made no errors. If making backups over a network, such as what I do. You will be prompted with the Administrator account name and the password for the destination machine. Then the command shell will fire off these executables automatically and that's it.
And the coolest feature of robocopy is that it will not recopy files. It will disregard all the old files on the destination drive only copying over the new files that have been added since the last backup.