Backup USB Drive on Insertion
April 25th, 2007 by Eric

This is a great way to backup a USB flash drive. After adding this batch file to your flash drive, just click the backup option to copy all files to your local hard drive.
Step 1: Create the folder you want to backup to (Mines c:\removablebackup)
Step 2: Create the backup batch file for your USB key. You can do this by inserting the following in a textfile and saving it as backup.bat. An example is provided below:@echo off
echo ——————-
echo Removable Device Automatic Backup
echo ——————-
echo No Rights Reserved, do whatever you want with this.
xcopy “*” “c:\removablebackup\” /Y /E /R
echo Backup Complete!
Pause.Make sure you change the section in bold to reflect your individual backup location.
Step 3: Place the following in a text document, and save it directly to your removable drive as autorun.inf:
[autorun]
action=Backup
open=backup.bat
label=Backup
includeRuntimeComponents=TrueStep 4: Your done! Now whenever you insert your USB key you should see this nifty backup option:
You can also add the /D flag to the xcopy command to only copy new/changed files.







0 Responses to “Backup USB Drive on Insertion”
Leave a Response