If you have a USB flash drive, then it is very likely that at some point in time you were interested in adding an autorun option, so that a program would start whenever the flash drive is plugged in. After several experiments, you probably concluded that it's not going to work, especially if you've read Microsoft's FAQ for driver developers.
The interesting fact is that somehow I actually managed to make it work. I haven't yet determined the key-factor which decides whether USB autorun will work or not, but the good old autorun.inf in the root directory approach still works. Apparently, USB autorun is allowed in XP SP2 (so SP2 is the key-factor), but I am not sure about that one yet.
So how does it work?
- create a blank autorun.inf in the root directory of the thumbdrive
- edit it with a text editor, the contents should be:
OPEN=PD\PrvDisk.exe /minimize /path:image.dpd /symbol:Z /RD
ACTION=Mount Private Disk
- ICON is an optional parameter, and it can be removed
- OPEN should not be tied to any paths, use relative paths if you want to make sure that USB autorun will work correctly on computers that have a different number of drives and drive letters
- ACTION can be customized, you can use any text
What is RunMe.exe you ask? In this case it is the EXE file the icon of which is used to represent the thumbdrive in the list of drives in My Computers. You can use an .ICO file for such purposes too.
However, RunMe.exe has another (more important) role. If autorun is disabled on a specific computer, you will not see the autorun menu when the thumbdrive is plugged in, hence the application will not start automatically. In that case you will be forced to explore the drive and run the program manually. But what if you need to launch the program with specific command line parameters? Open a console window and type the parameters there? Or use a .BAT script to do the same task?
The problem with BAT files is that you'll see a DOS window once the target application was launched, this window will have to be closed manually - and that takes time, and will soon become a very annoying procedure. RunMe solves this task by processing the autorun.inf file and running the program indicated in the OPEN section, along with its command line parameters [if any]. This will spare you from the tedious task of closing a console window (inexperienced users might not do that, being afraid of the consequences of an action they don't understand).
If autorun.inf is missing, or it contains invalid parameters (for instance - the path is invalid), the program will silently quit, without throwing any obscure error messages which can scare the hell out of newbies.
Follow this link to download RunMe USB autorun.