You are here

Autorunning your portable drive...

Submitted by nm35 on April 5, 2006 - 3:43pm

If you want your drive to automatically run an executable when you plug it in, and you don't want to buy a U3 drive, you're in luck. Here's what you do:

First, you have to make sure the computer you're at supports this trick. Insert a USB flash drive into the computer; a dialog box should pop up asking what action you want to take. If that dialog box appears, then this trick will work.

Open up Notepad or another text editor, and type in the following code:

[autorun]
open=PStart.exe
icon=icon.ico
action=Run PStart

Save this as autorun.inf in the root of the drive. Now, when you insert the drive, the first option in the dialog box will be "Run PStart." Neat, huh?

You can customize this -- "start=" tells the computer what application to run, and "icon=" tells the computer what icon to assign your drive. "action=" doesn't really matter -- you can change this to whatever you like.

Enjoy!

Comments

I have a Lexar 128mb flash drive. I put the file exactlly as you wrote it into a autorun.inf file in the root of the drive.

I also coppied PStart into the root directory.

I insert my drive into the computer and I get the What do you want to do pop up box, but no PStart.

Do you need admin priv?

Life is about the journey not the destination!

The Kazoo Spartan

If you did it right, the first option in the What do you want to do popup should be Run PStart, with the icon you selected.

This doesn't need admin privileges -- it works on a plain Limited user account.

~nm35
a.k.a. Mark

Do you have to put your icon file in the root directory that you want to use?

Life is about the journey not the destination!

The Kazoo Spartan

Not necessarily.

If you had a file structure like so:
\PortableApps\PStart.exe
\PortableDocuments\Images\USB.ico

you could change the autorun file like so:
start="\PortableApps\PStart.exe"
icon="\PortableDocuments\Images\USB.ico"

At least, it worked for me on my test system. Yours may be different, so if this doesn't work you're best off keeping it in the root of the drive.

~nm35
a.k.a. Mark

Maybe I am misunderstang what you mean as root?

This is the first folder that the drive opens up into right?

Life is about the journey not the destination!

The Kazoo Spartan

The root of the drive is the first folder that appears when you double-click on the drive in My Computer. (For me, it would be either F:\ or G:\, depending on what computer I'm at.)

~nm35
a.k.a. Mark

I also have a 128MB Lexar JumpDrive Sport.

I can;t get this to work either.

When i put the jump in, it shows an autoplay dialog that scan's the contents then shows the dialog box, but the Run PStart option isn't there.

so i had a question, does the filename need to be in quotes?

also, if you want to use the icon of the exe, in this case pstart, you can just do this:

icon=PStart.exe,0

i looked at an autorun.inf on a cd i had and it doesn't use start= it uses open= and doesn't display a dialog box, which would be better IMO, but i couldn't get that to work either.

at least i can change the icon lol Smile

EDIT:
I got it to work!

here's what i did:

-i went into the properties for my jump drive.
-clicked on the AutoPlay tab
-changed all the settings to "Take No Action"

then using this autorun.inf file:

[AutoRun]
open=PStart.exe
icon=System_X_Folder.ico
action=Run PStart!

it comes up with the dialog box, and Run PStart! is an option, and it works!