Sunday, January 11, 2009

USB Drive AutoRun

USB Drive AutoRun

Examples

----------------------

autorun.inf

---------------------

[autorun]

action=Run MojoPac

icon=.\progra~1\ringth~1\bin\RingOS.ico

open=.\Start.exe

label=MojoPac

-----------------------------

label=Saju

------------------------------

[autorun]

action=Run Avast

open=.\Alwil Software\Avast4\ashAvast.exe

label=Avast

------------------------------

Autorun.inf

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

where

option is the option that you want to set and value is the value that you are setting for that option. So, if you had an option foo and you wanted to be set to bar, then you would enter:

----------------------------------------

Setting a Custom 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 myico.ico and you wanted this to be the icon that showed up for the USB drive, you would enter:

Icon = myico.ico

You are not limited to .ico files. If, for example, you have an executable with a nice icon, you can specify it as the icon file. For example:

Icon = myusbicons.exe

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

Some files have more than one icon embedded in them. If this is the case, you can select which icon to use by specifing the index number after the file name. For example:

Icon = usbiconlib.dll,2

This will use the second icon in the usbiconlib.dll file.

-------------------------------------------------

Naming Your USB Drive

If you would like your USB drive to display a specific name othr than the drive label , use the label option. For example,

Label = MyUSB

----------------------

Setting AutoPlay Options

To specifies the program that you can run automatically with AutoPlay. Example, if we wanted to run a program called Mypro.exe , you would add the this to your autorun.inf file:

Open = Mypro.exe

If we want the message to say Mypro Open Program, add the following to autorun.inf:

Action = Mypro Open Program

No comments:

Post a Comment