Sync USB pen drive to local folder when plugged in?

That would be fantastic!

Is there any documentation on robocopy that I can have a look at (I mean read and then not understand and come and ask you anyway:p)
 
Here's my xcopy code

Code:
@echo off
echo -------------------
echo Removable Device Automatic Backup
echo -------------------
echo Back up only new and modified files...
xcopy "\My Documents" "D:\My Documents\USB Backup\" /Y /E /R /D
echo Backup Complete!
Pause.

Come on Bledd its your turn! ;)
 
ill have a look for my script later, bit busy in work

i made about 10 revisions, so i think i'm looking for 'backup mk10a.bat' lol

http://www.ss64.com/nt/robocopy.html


here's a good place to find info, and here's a good link with a GUI for it

http://technet.microsoft.com/en-us/magazine/cc160891.aspx

personally i don't use that much of it, but the GUI is good for starting off :)




echo displays whatever is after it, so

if you had your file like this..

@Echo off
title Mark's Backup
echo Starting backup....
robocopy etc..
title Backup complete
pause


that would give it a title screen and print on screen Starting backup..., then would prompt you with a pause after it

if you type (in cmd) robocopy /? it'll tell you the instructions for using it (all commandline tools work like that)

you can do things like add in "color c0", would make the window Red with black font, then you could put in another color (do color /? to find out what they are) at the end with green window & white font..
 
Last edited:
what does echo do?

Echo displays text in the command prompt window ie. "echo Hello World" would display "Hello World" in the window

Actually that isn't strictly true. By default "echo Hello World" would display "echo Hello World <new line> Hello World"

The @Echo off turns off printing of the commands so "echo Hello World" reads as "Hello World"

Copy and paste these two scripts into notepad and save as MTA99test1.bat and MTA99test2.bat (or something similar ;))


Code:
echo Hey Mark M!
pause

Code:
@echo off
echo Hey Mark M!
pause

See? :)
 
Ok next problem....autorun

I copied the file from a cd as suggested and edited it to

Code:
[autorun]
OPEN=Backup.bat

But when I plug the usb stick in it just brings up a diologue box asking me to a)open folder to view files or b) take no action

Any ideas?
 
Yes sir! The autorun.ini file, backup.bat and a folder called "files"

Edit - its actually Backup.bat. Wasnt sure it the capital letter mattered but they are exactly the same.
 
Yeah definately, see screenshot

autoruninf.JPG
 
Back
Top Bottom