I wrote a small how-to before on how to create an xcopy batchfile.
Here it is:
Okay, so you say you just bought an external hard drive for backup purposes and you do not want to manually drag new songs you just got, or new documents you just wrote. An easy way to do this by double clicking what is known as a batchfile (extension is .bat). What this will do is automatically update any file that changed. A batchfile derives from Notepad. You write the commands in the notepad then you: Save As >> [name].bat Then save.
You will need to use xcopy commands, as follows:
xcopy "C:\Users\*.*" "G:\BackupComputer\Users\*.*" /D /V /I /S /Y
Okay. This is what a batchfile looks like. At the top you see "@echo off". What this means is that there's not going to be any message at the top of the command promp (cmd). If I were to write '@echo Backup', then when you start the batchfile you will see the title of Backup at the top. I use '@echo off' because it makes the batchfile look cleaner (less writing).
You have to write xcopy because it is telling the batchfile how to work, it's telling the notepad that it will be used as a batchfile and it allows for the commands at the end of the line to be recognized "/D /V /I /S /Y" which will be mentioned later. Batchfiles aren't only for backing up, you can use them for other reasons. So if you use xcopy it tells the batchfile that it's a backup batchfile.
Make sure to use quotes ("") in each file location line so the batchfile knows it's all together. The first line after xcopy is the file that will be retrieved. In this example, I used "C:\Users\*.*\" This means that the batchfile will send those files to the second command we wrote, which in the example is "G:\BackupComputer\Users\*.*" So in basic terms, the files in my C: Users will all be sent to the external hard drive. You do not need to go in your hard drive to create files. Since our second command has BackupComputer in it, it will automatically create that folder for you. It will also create the subfolder of Users
Some of you might be wondering what "*.*" means. An asterik (*) basically means 'all/everything'. So if we use *.* at the end, it means that All files of All extensions will be added. If you only want music to be transfered, you simply do *.mp3 (or whatever file format you have) at the end, this will put All files with .mp3 as a file extension.
Now for the slightly more complex part. The ''/D /V /I /S /Y'' commands all have a purpose. If you want to know what these letters mean, go in your MS DOS screen (cmd) and write 'xcopy /?' This will show you all of the commands and what they do. You can add as many as you want but some are more important than others. You decide upon your personal preferences. If you want to have a normal backup batchfile, then just write ''/D /V /I /S /Y'' at the end and it will do what is normal, such as creating a time stamp and deleting the old timestamps (replacing old timestamps to new timestamps). So if you add a word to a document and click on the batchfile, it will add that word on the back up version.
At the end of the batchfile, you have 'pause'. You do not need to have that in for the batchfile to work but it's recommended that you do. Reasons why you should have that is because it allows you to know if your batchfile is complete. By having 'pause' at the end you will have a message saying ''press any key...'', letting you know it's done. If you do not have 'pause' at the end it will automatically close once finishing.
I hope this helped. It will save your time and effort once you get it to work. Don't forget, in the example I used G: because it's my default for my external hard drive. You need to put your hard drive root in the command so it access your external hard drive. If your external hard drive is in root F:, then you have to place the G: to F: (You find the root by looking in My Computer.)
Now you can double click your batchfile and go away from your computer and just let the batchfile do the working.
If you have any questions.. ask