How To Autorun Programs From USB Flash Drive And Add Custom Icons

Do you want that a certain program should run when you insert your USB flash drive? Or do you want to add a custom icon for your flash drive? If the answer to any of the question is yes, then you have come to the right place.

It is possible to auto run the programs and applications from your removable USB flash drive like the autorun feature in CD/DVD drives. The autorun.inf file is the key to getting your USB drive to perform certain actions automatically and customize it’s look in My Computer. The purpose of this article is to shed some light on how this can be done.

Note: Autorun feature does not work in Windows 7 any more, Microsoft has disabled it due to security reasons. But this feature works fine in Windows Vista, Windows XP, and older OS.

Basic Autorun.inf Structure

The autorun.inf file is a simple text file that can be opened up in any text editor (e.g. notepad). It always starts with a section header of:

[autorun]

Below this header is a list of different options. Each of these options is in the following format:

option=value

View in gallery

Setting Up AutoPlay Options

Autoplay allows you to set up what file is run when the USB drive is plugged into the computer. There are two options that work in concurrence with AutoPlay. The first is open which specifies the program that you can run automatically with AutoPlay. So, if we wanted to run a program called MyProgram.exe, you would add the this to your autorun.inf file:

open=MyProgram.exe

The second option that we add is the message the user is prompted with. To set this, we use the action option.

action=MyProgram Open Program

exe How To Autorun Programs From USB Flash Drive And Add Custom IconsView in gallery

When your autorun file is done, save it as autorun.inf. Once the autorun.inf file is saved, the flash drive autoplay will look something like this:

myprogramView in gallery

Customize USB Flash Drive’s Icon

To create a custom icon for your USB drive, use the icon option. Set it to the name of the icon file.

For example, if you had an icon on the root of the USB drive called sun.ico and you wanted this to be the icon that showed up for the USB drive, you would enter:

icon=sun.ico

You can also use some other application’s icon by specifying

icon=Photo.exe

This is valid as long as Photo.exe is available on the root of the USB drive.

Label Your Flash Drive

If you want your USB drive to display a specific name other than the drive label created when it was formatted, then use the label option. For example, if I wanted to call my drive Asad Drive, I would add this to my autorun.inf file:

label=Asad Drive

labelView in gallery

Now, when you look at your USB drive in My Computer, it will say Asad Drive by the drive letter.

Autorun Files or Web Addresses

If you wanted to view a file on your USB drive in the default application instead of running a program on the drive, you can substitute the open option for the shellexecute option. For e.g

shellexecute=Readme.txt

readmeView in gallery

if you wanted to open up a website www.google.com in the default web browser, you could use the following:

shellexecute=http://www.google.com

readmewebView in gallery

Now start customizing your USB drive now. Don’t forget to leave a comment. 🙂

–>x3Cscript async src=”http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”>x3C/script>x3Cscript>x3C/script>’);

قالب وردپرس

About Alyse Kalish

Alyse Kalish
As an Associate Editor for The SalesJobInfo, Alyse is proud to prove that yes, English majors can change the world. She calls many places home, including Illinois where she grew up and the small town of Hamilton where she attended Colgate University, but she was born to be a New Yorker. In addition to being an avid writer, Alyse loves to dance, both professionally and while waiting for the subway.

Leave a Reply

Your email address will not be published. Required fields are marked *