Auto Backup to USB

  lothlann 17:17 09 Nov 2009
Locked

Does anybody know of a way to auto backup to USB?

Im running Windows 7 and my basic issue is I want my USB to automatically copy the contents, including all subfolders, of this folder:

C:\Users\Serhan\Documents\Law

to USB (call it G:\Backup) whenever I insert the USB.

This folder contains all my uni work including my dissertation so its pretty important to me.

I have tried the instructions here:

click here

But to no avail.

I created a backup.bat that said:

@echo off
echo ——————————-
echo Removable Device Automatic Backup
echo ——————————-
echo
xcopy “C:\Users\Serhan\Documents\Law” “\backup” /Y /E /R
echo Backup Complete!
Pause.

and an autorun.inf that said:

[autorun]
action=Backup
open=backup.bat
label=Backup
includeRuntimeComponents=True

But when I try running the Backup.bat it says Law cannot be found, no files copied.

Is this because Im using Windows 7 or have I done something stupid?

Thanks

Lothlann

  jamesd1981 17:43 09 Nov 2009

ive never seen as usb flash drive with an auto backup facility but if your willing to spend a few quid you get a couple of auto backup external drives tesco has one for around £50 i think is either a 250gb or 320gb.

  Peter 18:27 09 Nov 2009

.

Perhaps the sixth line of your batch file should be :-

xcopy “C:\Users\Serhan\Documents\Law\*.*” “\backup” /Y /E /R

instead of

xcopy “C:\Users\Serhan\Documents\Law” “\backup” /Y /E /R

so that all files in the Law folder are copied, not just the folder itself.

Peter.

  MAJ 20:44 09 Nov 2009

@echo off
echo -------------------
echo Removable Device Automatic Backup
echo -------------------
echo No Rights Reserved, do whatever you want with this.
xcopy C:\Users\Serhan\Documents\Law /Y /E /R G:\backup
echo Backup Complete!
Pause.

  MAJ 21:49 09 Nov 2009

The quote marks around the file path are not needed as there are no spaces in the file path, e.g.

“C:\Users\Serhan\Documents\Law” should read
C:\Users\Serhan\Documents\Law

If the file path was:

“C:\Users\Serhan\Documents\Law Folder”

then the quote marks would be required because of the space between "Law" and "Folder" in the file path.

It's also the same for: “\backup” and backup isn't the full path, it's G:\backup

  lothlann 21:50 09 Nov 2009

Thanks Peter that worked great.

One thing though, it doesnt seem to autorun, it runs fine if i run the bat file myself. Is there something wrong with my .inf file?

  gigagiggles 23:18 09 Nov 2009

for general win 7 security, usb autorun was disabled to prevent spread of malware via mechanism.

  lothlann 11:59 19 Nov 2009

So there is no way to make it autorun? Im ok with having to run my .bat file myself but is there anyway to have it included in the autoplay menu? So when i plug it in up comes autoplay menu and i click on the Backup.

Is this possible?

  lothlann 18:35 14 Mar 2010

Anyone know if autoplay is possible?

Also I now want to back up from several locations.

C:\Users\Serhan\Documents\Law
C:\Users\Serhan\Documents\My Books
C:\Users\Serhan\Documents\My Digital Editions
C:\Users\Serhan\Documents\Contracts

I have no idea how to use the xcopy syntax to do this. I tried listing them one after another but it failed and im unsure why.

Anyone got any ideas?

  BRYNIT 20:51 14 Mar 2010

You could try.

Backup.bat file

@echo off
echo ——————————-
echo Removable Device Automatic Backup
echo ——————————-
echo
xcopy "C:\Users\Serhan\Documents\Law" "Law"
xcopy "C:\Users\Serhan\Documents\My Books" "My Books"
xcopy "C:\Users\Serhan\Documents\My Digital Editions" "My Digital Editions"
xcopy "C:\Users\Serhan\Documents\Contracts" "Contracts"
echo Backup Complete!


Autorun.exe file

[autorun]
action=Backup
open=backup.bat
label=Backup
includeRuntimeComponents=True

It works on Windows Vista so should work with Win7

If the directory is not on the flash drive it will ask if its a file or directory press D for each directory.

If the directory is on the flash drive and duplicate files are there it will ask if you want to overwrite these files.

  MAJ 20:58 14 Mar 2010

"Also I now want to back up from several locations."

@echo off
echo -------------------
echo Removable Device Automatic Backup
echo -------------------
echo No Rights Reserved, do whatever you want with this.
xcopy C:\Users\Serhan\Documents\Law\*.* G:\backup /Y /E /R
xcopy "C:\Users\Serhan\Documents\My Books\*.*" G:\backup /Y /E /R
xcopy "C:\Users\Serhan\Documents\My Digital Editions\*.*" G:\backup /Y /E /R
xcopy C:\Users\Serhan\Documents\Contracts\*.* G:\backup /Y /E /R
echo Backup Complete!
Pause.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 5 review

Alice Saey's mesmerising animation for Dutch singer Mark Lotterman

iPad Pro 10.5in (2017) review

Comment booster votre iPhone ?