script to auto run a usb .exe file

TriggerHappy101

Golden Member
Jan 13, 2005
1,006
0
0
Is there a way I can get my usb device to auto run a .exe file when it is plugged into ANY pc without configuration to the PC? I ask because I have a firefox portable installed on my USB drive and i want it to auto launch as soon as it detects the drivers. I want it to auto launch the "FirefoxPortable.exe" file inside the root directory of its drive.
 

gsellis

Diamond Member
Dec 4, 2003
6,061
0
0
Originally posted by: TriggerHappy101
Is there a way I can get my usb device to auto run a .exe file when it is plugged into ANY pc without configuration to the PC? I ask because I have a firefox portable installed on my USB drive and i want it to auto launch as soon as it detects the drivers. I want it to auto launch the "FirefoxPortable.exe" file inside the root directory of its drive.

Not if I can help it (the ANY part). For your own use, you could create a service that would watch for the PnP ID and then check the device id to run the exe. Otherwise, not a prayer. Even CDs running autorun are a huge security risk (the Sony Rootkit being a prime example), so you are already fighting against folks turning off any chance of autorun. In the next, next gen OS, even the device may not plug in unless it has been trusted.
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
I have a Sansdisk MicroCruzer memory stick that has a automatic run partition whenever it gets plugged in.

Therefore it must be possible
 

Kelnoen

Senior member
Sep 20, 2006
409
0
0
Depends if the pc has autorun enabled but surely you can just create an autorun.inf with:
[autorun]
OPEN=firefox.exe

or something similar.

Edit: try Autorun.ini too
 

TriggerHappy101

Golden Member
Jan 13, 2005
1,006
0
0
Ive tried Autorun.ini and Autorun.inf and Autorun.bat with the command
[autorun]
OPEN=FirefoxPortable.exe

Ive also tried making the Autorun.ini and Autorun.inf file open Autorun.bat that has the command
"FirefoxPortable\FirefoxPortable.exe"
Which launchs the program if I manualy run the .bat file. But doesnt work on autorun.

Any ideas to get it to work? How do I double check if i have autorun enabled? I know I have Autoplay enabled.