Creating a batch file

Geoff

VIP Member
i have an external hard drive which i use for backup's only, and what i do now is copy and paste my documents and my family's documents to it, but this is a fairly long process. I would like to be able to create a batch file that copies my favorites and documents to the hard drive, and my mom and sisters favorites and documents.

The backup drive is at my computer, while my mom's and sister's is on another computer which are networked. Any help would be appreciated. thanks
 
just use the copy command

somethin like
copy c\[path to sourse]\* f:\[path to destination]
it is over a network you can do 2 things
1. You can just map a network to the folder you want to back up from on your moms/sister pc this will assign a drive letter on you pc pointing to the network folder.
Then use the copy command using that drive letter

2. You should be able to specify the name of the share that hold the file you want directly in the copy command
copy //[Source Comp]/[path to source files]/*
 
i got it to copy the documents to the backup drive. but now i need the program to delete the current files, then back it up, since it doesnt work if there are already the my documents folder.

This is the drive path: F:\Backups\Geoff\My Documents

thanks.
 
are the documents on a seperate partition or drive? I wonder if you could just set up the USB drive in a raid 0 configuration.

or just put "del D:\* /F /Q" where D is the USB drive letter in the batch file before the CP command.
 
i probably should have mentioned this earlier, the backup drive is an External Western Digital 80GB USB, so i cant raid them. And since documents are on 2 computers, one will be a local drive and one will be a networked drive.
 
well the del command will work on the computer the drive is hooked up to. Then you should be able to map the network drive from the computer the drive is attached to and just use two seperate copy commands

so your file would look similar to this if the usb drive is U, your drive is A and her's is B

del /F /Q U:\*
copy "A:\.......\My Documents" "U:\My Documents"
copy "B:\.....\My Documents" "U:\Her Documents"

You might also be able to do it like this too:

copy /Y "A:\.......\My Documents" "U:\My Documents"
copy /Y "B:\.....\My Documents" "U:\Her Documents"
 
Last edited:
for some reason cmd wont allow me to network a path, it says "UNC paths are not supported. Defaulting to windows directory."

so i think i'll just use a batch file for backing up my documents on my comp, and just manually do it on the other comps. thanks for your help though.
 
i think you might need to do it as file:\\"networked drive"\.......

you also might try the xcopy command. it's a little more robust then copy
 
Back
Top