Introduction: 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.

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:

"(Autorun)
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:

(Autorun)
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.

MAKE SURE THE FILE EXTENTION IS " .inf "

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

(Autorun)
Open=FirefoxPortable\FirefoxPortable.exe
Action=Start Firefox Portable
Label=MY USB
Icon=FirefoxPortable\FirefoxPortable.exe

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"

Comments

author
Răducu'sC (author)2017-08-02

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

But you can specify a Icon like this:

[Autorun]

Icon=icon.ico

author
Azulnessa (author)2016-04-25

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

author
CalumGC (author)Azulnessa2017-04-12

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

author
calebhk98 (author)Azulnessa2016-08-18

It doesn't work on my Win 10

author
Nemraiku (author)2016-05-20

Or you can buy a usb rubber ducky

author
westfw (author)2008-02-14

Having your computer configured to autorun programs from USB flash drives is SCARY.

author
PerfectlySquare (author)westfw2008-02-14

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, PortableApps.com 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! )

author

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

author
cry_wolf (author)dark-shot6662008-02-14

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?

author
KacperK7 (author)cry_wolf2016-01-23

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

author
GraysonS2 (author)cry_wolf2015-07-09

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

author
HackingPanama (author)cry_wolf2014-08-06

Really yes, you just copy (cp command) the program in the C:/windows or something like that and run the program on this path, this is more complicate but is posible...

author
dark-shot666 (author)cry_wolf2008-02-15

stuff like this dont require coding knowledge. and you could, but it aint recomended. legal issues could surface, or just general crap. dont use a keylogger. give people their privacy.

author
cry_wolf (author)dark-shot6662008-02-15

Yeah, i would never use one, i was just wondering if it was possible.

author

Speaking of spoofing a legitimate entry, do you know how to find a webkey on a macintosh finder. I thought that if you were that smart you may know...

author
erikals (author)PerfectlySquare2009-08-16

wats ZOMG?

author
microman171 (author)westfw2008-02-14

Fun though! In the computer lab my friend was trying to do this for ages. He was trying to run a shutdown bat. BTW. What is the theme of the comp? It looks great. Great instructable

author
dark-shot666 (author)microman1712008-02-14

zune for vista. check out deviantart for themes. ill be making an instructable on how to use 3rd party themes for xp and vista.

author

without windows blinds

author
microman171 (author)dark-shot6662008-02-14

Sweet! It looks great!

author
JohnnyDcrypt (author)2015-11-29

I tried it, but it wont work on windows 7. how do i do it on 7?

author
GraysonS2 (author)2015-07-09

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

author
JeremyI (author)2015-06-14

Ummmmm... U realise there are password grabbing applications out there for so and after seeing this I realise that when my friend plugs in a USB he could be stealing my passwords just by sticking his USB in. :(

author
lmuscarello (author)2014-05-23

is there a way to send someone directly to my website when they plug in the usb

author
Josh.A (author)lmuscarello2014-08-07

Yes there is :D

just do Start=[Http://Address here]

author
jonnydesp (author)2009-12-06

how to autorun without this windows(confirm)???

author
locofocos (author)2008-04-19

I won't go any deeper than this, but there is a program out there called Thinstall which lets you make portable apps that are a single file.

http://www.thinstall.com/

Of course, I would never endorse pirating software. (they won't even give you a freakin demo version unless you write in to them and own a business)

author
erikals (author)locofocos2009-08-16

is it freeware?

author
VaKoN (author)2009-02-02

HOW DO I ADD THE .INF TO THE ROOT?!?! i cant get to the root of the usb Also , I want to autorun a .PDF with videos from my USB. do i need a portable pdf reader??

author
fwjs28 (author)VaKoN2009-02-03

open up myy computer....then double click on you r jump drive and then, your in the root...

author
VaKoN (author)fwjs282009-02-03

ok then i did all that and it doesnt work, it only worked on vista.....

theres no way on making it work on xp.... or mac at the same time??
btw im trying to autorun a pdf
=)

author
fwjs28 (author)VaKoN2009-02-04

wait...im confused....you understand what root is, right?....it might not work on Xp b/c youll have to right click>properties> autoplay tab and tinker around in there....

author
VaKoN (author)fwjs282009-02-21

The reason why i couldn't make the autorun work was because an autorun.inf virus from my university copied itself into my usb and got into my computer.

The virus creates a recycler hidden folder aswell as an autorun.inf hidden file. If I made the autorun.inf file with the specifications i needed to make the PDF autorun, the virus would overwrite MY autorun.inf with his and automatically hide it.

The recycler contains a code wich runs a win32.exe wich is the autorun creating virus! I have deleted this virus with malwarebytes program but only after i dissabled the restore sys files option from my folders. now im doing another search to see if its still there. =)

author
fwjs28 (author)VaKoN2009-02-21

o my...

author
VaKoN (author)fwjs282009-02-04

cant do much exept choose between content types and actions, but i dont see nothing of what i wrote on the notepad or cant add the pdf into the actions... on vista it only showed the icon and nothing else.... thanks for the help btw

author
fwjs28 (author)2009-02-21

DONT DOWNLOAD!!! THIS IS A BOT!!!

author
raykholo (author)2008-12-03

they have u3 smart flash drives now -- u can have it do this automatically.....

author
fwjs28 (author)raykholo2008-12-27

portableapps.com is way better than U3......

author
raykholo (author)fwjs282008-12-28

whatever u like i got a good deal on my flash drive and it came with u3 so makes my life easier.. and i dont need most of the stuff on that site anyway

author
fwjs28 (author)raykholo2008-12-28

true, but you can easily make any program work with portable apps.....U3 is only selected software.....

author
fwjs28 (author)Foaly72009-02-03

WRONG....not all programs work....certain files are not compatible....and stop yelling.....

author
raykholo (author)Foaly72009-02-02

k i really like that instructable now...

author
raykholo (author)fwjs282008-12-28

like i said -- whatever u like

author
raykholo (author)raykholo2008-12-03

o yeah--- and a lot more

author
jchar77 (author)2008-10-18

You seemed to have blocked the name of the usb on the photos, but what about the photo displaying Notepad?

author
Arbitror (author)jchar772008-11-02

"RICHS USB"

author
jchar77 (author)Arbitror2008-11-02

I don't get it....

author
Frogzard101 (author)2008-03-01

how do you get it to run multiple programs?

author
dark-shot666 (author)Frogzard1012008-03-02

not sure. ill look into it. probably involve using a batch file. ill make one, post it, and make corrections.