Batch file help.

Soldato
Joined
30 Jul 2004
Posts
10,572
Location
East Sussex, UK
Howzit guys,

I have made a batch file that when I click on it, it backs up all my documents etc to an external drive. When I run it again, it only backs up what is new on the source drive (The PC) to the destination (The drive).

How do I ask the batch file to check that if a file is no longer on the pc but on the hdd, it must as me if I want to delete said file? or visa versa?
 
Robocopy will do that for you. If you've got Vista or Windows 7 robocopy is already installed in the system32 folder.

I use the following script...

Code:
robocopy /e /MIR "C:\SOURCE" "D:\DESTINATION"
 
I use the following script...

Code:
robocopy /e /MIR "C:\SOURCE" "D:\DESTINATION"

no need for /e when using /MIR. also the OP asked for prompting. using mirror mode, robocopy just automatically deletes the file from the destination if it doesn't exist on the source.
 
Back
Top Bottom