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.

Remove these adsRemove these ads by Signing Up

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

Step 2: A More Complex Autorun

Picture of A More Complex Autorun
If you want a USB drive that actually does something when you plug it into a computer, then this is the step for you.

Type the following into Notepad or Notepad++:


This is a short explanation of the new stuff you just typed:

open: Duh. This will open a file that you choose. If that file is in a folder, you would type the following:

action: This is what you want the option to be called. If you remember, the option's name on the first page was "Heal People". Refer to the picture to see what I mean.

Step 3: An Autorun file with extra Commands

Picture of An Autorun file with extra Commands
autorun lost 2.bmp
autorun lost 4.bmp
The previous steps just messed with the name, icon, and actions of the USB drive. Now, I will show you how to add extra commands to the USB drive. These commands will show up when you right-click on the USB drive.

If you lose your USB drive often, you should 1) buy a keychain for it and 2) add this to your Autorun file:

shell\lost=Help! I'm Lost

NOTE: This command is not only for a lost USB drive. You can make it anything you want.

shell\lost\command=: This is the file that will open when you click on the "Help! I'm Lost" command.

shell\lost=: This is what the name of the command is. Look at the picture for more information.

Also, the computer does not have a file called "Lost.bat" already on it (duh). You will have to make one. This is some good code for the batch file:

@echo off
title Please Return Me!
echo I have been lost! Please return me to my owner!
echo 1234 Second St. Small Town, America, 12345
echo 1-555-555-5555
goto top

I have written this code so that if someone presses a key (like the file asks you to, see the screenshot), it will simply repeat itself! It will continue to do this untill the finder of the drive closes out of the CMD window.

PLEASE make sure that you replace the info with your actual address, phone number, and email (unless you happen to live at 1234 Second Street, Small Town, America, 12345).

There are countless possibilities that you can place here. Also, you can insert more than one, so you could have a "Help Me" option, a "Hello" option, and a "Destroy the Earth" option. Have fun with that (and be legal!).

Step 4: The End

Picture of The End
Well, I hope that you found this helpful. I know that there are many more commands that I left out, and I did that because I did not want to have to explain them to some little kid who just wants to give his new 1gig a power-rangers icon.

Feel free to leave comments, give suggestions, make corrections, and vote.

If you have trouble making the autorun file, you can download the text file version of one I made. Just replace the information inside it and save it as a .inf file.

ALSO, the icon and open fields cannot have multiple words in them. Use the underscore symbol if you have to, but NO spaces.
autorun.txt96 bytes
1-40 of 83Next »
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?

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

pfouquet3 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!1 month ago

I did it!

jatinbal.jb3 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.jb3 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!

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

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

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

JakaramaO7 months ago

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



label= 2gb


Action=Start scratch


shell\lost=Help! I'm Lost

OompaG JakaramaO7 months ago

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:
achhabra12 years ago
how to make autorun of devicon.fil and devlogo.fil files?????
parth_13132 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.
Berkin5 years ago
I made a program in Visual C# that makes these files for me.. :D
1-40 of 83Next »