Sync USB pen drive to local folder when plugged in?

yeah, but say you've updated filea.txt and saved it, sure it fits the "updated since time dot" profile, so it copies it across

if you run the bat file again without changing filea.txt, it will still fit the "updated since time dot" profile... so it will be copied again
 
also anyone using that method, don't call it robocopy.bat or it'll just keep calling itself all the time :D
 
yeah, but say you've updated filea.txt and saved it, sure it fits the "updated since time dot" profile, so it copies it across

if you run the bat file again without changing filea.txt, it will still fit the "updated since time dot" profile... so it will be copied again

That's the case if you specify a date but xcopy /? states:

command prompt said:
/D:m-d-y Copies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time.

Just use /d without a date (as I posted above ;))
 
Didn't know you could assign drive letters permanently on usb sticks, that's a neat trick!

Now to assign the same letter for each of my 3 USB sticks for every single computer I ever use! :p
 
Ok had a go at this and it sort of works!!

When I run the bat file (no autorun yet) the files end up "backing up" to the USB stick

Here is the code I used, I think the issue is with the username. How do I check to see if I have the correct one? I went to c:/documentsand settings and typed out the exact name that is there

Code:
robocopy /e u:\files %m.surname.domain%\desktop\docs
 
Last edited:
Ok now its not working at all, dos prompt just flashes up and dissapears too quickly to read it

Edit - new code to check

Code:
robocopy /e u:\Files %userprofile%\desktop\docs
 
does 'docs' exist on the desktop (create that folder)


to read it, you could add a

pause

line at the end of the bat file, or you could open it through cmd :)
 
Ok, I changed the script from userprofile to username just to check and it puts a new folder on the usb drive with the username and the files inside of it.

It hasnt got anything to do with it being on a network and the user profile on the network drive?
 
when you type in %userprofile%\desktop into a run box, where does that take you? (it'll resolve to the real folder's name)
 
Ok, added the pause command and had to take a screen shot of it

robocopyscreen.jpg
 
ahhh, sorry, i've been using vista, doesn't have space in the name

put the " " around the path..

so "%userprofile%\Desktop\docs"
 
will work fine :)

just keep the " " on it

%userprofile% for xp will be c:\docs & setings\name on vista it's C:\users\name



%userprofile% is a universal way (for windows) for getting to the user's profile


won't be a problem :D
 
np

i spent a day making a robocopy file in work before, it creates logs, installs robocopy if it's not there already, and asks if you actually want to do it now or later, i'll post it tomorrow

it appends the log file each time it runs too :)
 
Back
Top Bottom