Picture of How to make an Autorun.inf File
In a previous Instructable, I went over this quickly and did not explain it very well. I was asked to make a full Instructable on Autorun.inf files, and here it is.

An Autorun.inf file is a file that, when placed on a drive (internal or external), will allow the drive to start programs, have a different icon than the standard boring one (LOTS OF FUN TO MESS WITH), and have a different name. The syntax is "option=value". Examples will be given later on.

Continue if you want to learn more.


Step 1: A Basic Autorun File

Picture of A Basic Autorun File
autorun basic 2.bmp
autorun basic saved.bmp
files saved 1.bmp
In this step, we will make a basic, do-nothing Autorun file. All that will change is the name of the USB drive, and the icon that goes with it.

Open Notepad (or Notepad++ or what ever you use) and type the following:


Where it says autorun, insert brackets around the word. I cannot type this in the Instructable, as it the Instructable creating software would turn the word into a link. Refer to the picture for the correct format.

Here is what you typed:
autorun: This states that this is an Autorun file, and what follows describes what the drive will look like and how it will act.

icon: This will change the icon of the drive (in the "My Computer" screen) to a custom one that you choose. The picture you choose must be an icon file (it must have the extension ".ico"). You can get pictures of that format from http://www.iconarchive.com/ and many other websites.

label: This will change the name of the drive to whatever you choose, as long as what you choose does not contain too many characters.

OK. Save the file to the main directory on your drive ("My Computer, Removable Drive X"). Eject the drive, then plug it back in. If you saved it to an internal hard drive, you will have to restart the computer.

If you are adding an icon to the drive, you will need to have an icon file to go use. An icon file is NOT a picture you got off the internet. It must have the extension ".ico". If it does not, then it will not work. Place the icon in the same directory as the Autorun file. Once you have done this, go back into the Autorun file and change the line that says icon=NAME.ico to have the name of the icon (keep the part that has the ".ico".
1-40 of 84Next »
Stan20001 year ago
you guys are all saying that it doesnt work on windows 7 and 8 but can someone please post a way to pass the security of windows?

Microsoft disabled the autorun.inf features(not all of them, but most of them) due to security issues, the only way to bypass it would be to write a script on the computer itself that would
1)check for connected devices
2)check for a specific file on those devices(such as "autorun.dll")
3)open/run that file


You would have to have that script installed and running on any computer that you would want to bypass the security system for.

ScottB9 Stan20005 months ago

... No XP either.

At least I managed to do step one which could be useful, sadly I wasn't able to give the option for autorun a file which would have been useful, from what it looks like it might be because I am doing this on Windows 7.

pfouquet4 years ago
Here is my auto run,
Open=Portable Apps\StartPortableApps.exe
Action=Start PortableApps

although i cannot open the program with it,
my usb is on my F: drive, and the dir of the files is correct, i have made sure, whats wrong?

Open=usb\directory of exe.file

Simple to explain,

An autrun file has been created for optical drives like cd-roms and dvd-roms. These days these files are still used to install applications from optical drives and are autrun files on flash drives used only to show manufactorers icons.
the problem is windows 7, they took the (they being MS) fuctionality out, for security reasons, i am running it currently, so if you have Win7 you can use autorun, Vista n XP still can
TheoA2 made it!6 months ago

I did it!

jatinbal.jb8 months ago

Hey guys! i am trying to make an autorun.inf file of a batch file the coding of autorun.inf is this


icon=jatin bal.ico

label=Removable Disk

open=JB Anti-Virus.bat

action=Mouse Disable

and it is not working (i am using win 7 & win 8) only it changes the drive name and icon do not autorun the file. can anybody tell me what happen. Please help me!

jatinbal.jb8 months ago

Hey guys! i am trying to make an autorun.inf file of a batch file the coding of autorun.inf is this


icon=jatin bal.ico

label=Removable Disk

open=JB Anti-Virus.bat

action=Mouse Disable

and it is not working (i am using win 7 & win 8) only it changes the drive name and icon do not autorun the file. can anybody tell me what happen. Please help me!

RiekeM9 months ago






Why nothing happend even if all setup is already allowed (I use win 8) ?

Want to make autorun for TV. So, I just plug the usb, it will run automatically.

Please help, thanks....

OPen and ShellExecute cannot open multimedia files.

binary files only.

ramagodz9 months ago

Windows 7 has prevention for Autorun script. So that's why you can't use this method.

Well, I can get the Autorun Label and Icon properties to work, but the Open and Action commands are not working.




action=Open Menu


This may have something to do with the fact that I'm opening it from an SD card...? Any suggestions?

boulis.shenoda11 months ago

I have made an autorun.inf to fun an application on my USB automatically ,but it does not work on Win7.......Is there a solution???

JakaramaO1 year ago

For some reason my open, action, and shell command won't work.



label= 2gb


Action=Start scratch


shell\lost=Help! I'm Lost

I'm PRETTY certain that open was removed in win 7 for security reasons, however I'm unsure of the rest.

vigneshb151 year ago

HI guys,

I am using windows 8, I want to run AppName application(.exe) while insert a Pen drive on my pc.

This is my autorun.inf file in Pen drive.

Here i notified that label, icon are displayed. But the exe is not executed. (Open Command doesn't work for me)





Any suggestions please.....???

Starting from windows 7 autoplay from Removable disks have been restricted due to security purposes everything but the icon and label line is ignored....
It still works with CD/ROMS
kysinden1 year ago
Windows 7 prevents the use of custom autruns as it makes viruses extremely easy to spread virus and stuff/thangs.
the autorun not working for me.WHY?????????
fahmad32 years ago
The problem is windows 7, I tried on win XP and it worked fine, it also works for vista
fahmad32 years ago
The icons are fine but this isnt working, please help
fahmad32 years ago
This isnt working
I created an autorun like this:
fahmad32 years ago
Thanks, this information was very helpful,

Can you make an instructable on "How to Create Log Files"
I'll be very thankful my email is: carljhonson623@gmail.com
achhabra12 years ago
how to make autorun of devicon.fil and devlogo.fil files?????
parth_13133 years ago
Hello I m new out here .
Can v make 2 autorun files in a single pendrive
my auto run:

action=Be a boss!
icon=HD Box2.ico

Wy won't it run?
action=Be a boss!

You are not allowed to use strange characters in this small batch script.
Thats why it dont works.
pokeroz4 years ago
was wodering if u knew how to make auto run open a .exe on the usb and by the way great interstruable
fix your grammar, "wodering, interstruable" really? I'm thirteen and I have better grammar than you, sad.
spelling. fix your spelling. *facepalm..... silly thirteen year old
Ba, too true. As unfortunate as that is. I wonder how he even gets on here with spelling like that.
While you are on a grammar kick, furry, you should really combine your first two "sentences" into one parenthetical idea. Observe:

"Ba, too true. As unfortunate as that is." now becomes: Ba, too true (as unfortunate as that is).

As your comment stands, the second sentence: "As unfortunate as that is.", is a fragment.

Have a nice day.
Besides, this was almost a year ago.
I shouldn't have said some of the stuff I previously said and I am now almost fourteen and can see what a stupid seventh grader I was being at the time. I now am much smarter and I tend to be nicer too.
No need to be a ___ about it. He is probably from another country.
I guess you are right, well at least I hope that. I shouldn't have been so harsh.
1-40 of 84Next »