Autorun Anything Off of a Usb Key




Make any usb key (pendrive/mass storage device ect.) autorun anything that you want (windows only)

Dead simple, only common sense required.

(btw this is my first instructable. tips are gladly welcome.)

AND PLEASE don't use this for bad purposes.

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: Get the Stuff

first off we need a couple things:
- a usb key/storage device
- microsoft notepad (comes with windows, is needed because other word processors add extra coding)
- a program/batch file/whatever you want that can launch

when you have all that, copy/install whatever you want to your usb key

Step 2: Lets Make the File

open notepad and type:

Open=(directory of program\program name.file extention)
Action=Start (Name of program if wanted)
Label=(what you want the label to say)"

without " "s.
if you want the icon as well, add "Icon=(director of program\program name).exe"
so it would look like:

Open=(directory of program\program name.file extention)
Action=Start (Name of program if wanted)
Label=(what you want the label to say)
Icon=(directory of program\program name).exe

swap out the brackets "( )" around 'autorun' with square brackets "[]"

afterwards, save it as "Autorun.inf" in the root of your usb key.


example of what it would look like to launch firefox portable that was just installed:

Action=Start Firefox Portable
Label=MY USB

the image below shows the directory of Firefox Portable on my usb key

Step 3: Hide It

Hiding the file will not make it visible (duh) so that it cant be deleted accidentally.

now go to the file, and right click it, and click "properties"

in the attributes section check the box beside "hidden" and click apply.

Step 4: Try It

remove the usb key, and plug it back in. If all was done right it should Autorun. If not just double click the usb key icon in my computer and it should launch! There you have it.

NOTE: If you do have other things on your usb key that you want to access, right click the usb icon in my computer and click "open"

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    61 Discussions


    3 years ago

    This trick shouldn't work on any computer running windows 7 and up. Does anyone know if it will?

    4 replies

    Reply 1 year ago

    I'm on Windows 10 and it didn't work for me...


    Reply 2 years ago

    I am not sure, but try replacing (autorun) with [autorun]


    1 year ago

    It didn't work for some reason...

    Cold Eye

    Question 1 year ago on Step 4

    Is there's a way to automatically delete's the file when you insert the flash drive on a certain computer?

    1 answer

    Question 1 year ago on Step 4

    how do I make it so that it pursues one command then the other and text in front of image so that text is transparent and back image in full screen.


    4 years ago on Introduction

    Im confused Im doing a simple .bat file but there is no company that made it so I put in a random name for the parts tht said portableapps is that ok

    1 reply

    Reply 1 year ago

    Yes, it is. In fact, you can just delete the lines for the name and icon. Windows will just use the default name and icon.


    2 years ago

    On newer versions of Windows the program run will not work, sadly :(

    But you can specify a Icon like this:




    3 years ago

    Or you can buy a usb rubber ducky


    Reply 11 years ago on Introduction

    Thankfully, it's not fully automatic in starting programs, but a malicious program could be triggered by spoofing a legitimate entry (i.e. What looks like an entry to run Portable Firefox, actually executes malicious code). Scarier still is that U3 drives CAN auto run programs and code without any input from the user! There are numerous tutorials on this across the Internet, and while it's slightly technically inclined, it's simple enough that a great number of people could make a drive which when inserted wreaks real havoc on the system it's plugged into. Just a heads up, folks. Having auto run enabled for ANY device (CD-ROM or removeable media) is a pretty large security hole. If you trust what you put in, and don't leave your system unattended where malicious users can access it, then you're not really at much risk. But for any reasonably public computer, it's a very bad idea. A hacker can basically stroll up, drop a CD or USB drive into the system, and walk away...leaving his malicious code destroying your data. With 256MB flash drives at a nearly disposable price, it's a blossoming risk! That said, is an awesome site, and I never leave home without my 4GB flash drive, which has the only browser I ever use, as well as ZSNES and Nestopia, a full office suite, and more. If you have a flash drive, you absolutely must check them out! (Oh yeah, and did I mention that all that software is FREE!! ZOMG! )

    Too true. but it is usefull for if you use a portable program often. I use Firefox portable on any of the pcs at my school. I got a 4gb U3 drive, and I hated it. so I removed it, and installed a bunch of portable apps. btw the portable apps menu will show any program you want if its in its file folder. i got reaper, a free dj/production program. kicks ass


    Reply 11 years ago on Introduction

    I'm not a coding guru like yourself, but isn't it possible to autorun a keylogger so that it installs on to the host pc, or if you leave the usb in that it would continue to run?


    Reply 3 years ago

    Yeah, just go on the keylogger, go on edit, save the code as a .bat file and then you can just autorun from there ! please be a white hat . its not noice


    Reply 4 years ago on Introduction

    Leedle Yea me neither becaus I dont want to ruin my pc in the process but batch or inf isnt hard really