hi
I write a application and store it in a flash memory.
I want to run the application automatically when I connect the flash to computer. in some article in the web i found about autoran but in those ways you should open the flash for ones, but i want to run the application without open the flash.
Loading


VulpesRank #55 · 29.2K reputationPosted Nov 10, 2011, 7:04 AM EST
http://bytes.com/topic/net/answers/102489-how-detect-usb-device-being-plugged-unplugged
there's some expert WMI code in the final post which can monitor USB events including detecting when a USB device is plugged in.
You should be able to use that to launch your application from the UsbEventArrived event handler.
Javeed M ShaikhRank #839 · 2.7K reputationPosted Nov 10, 2011, 7:07 AM EST
try this..
create a autorun.ini or autorun.inf (i do not recollect now) file with the following details:
[autorun]
open=MyProgramName.exe
Save the file on your flashdrive and change the attribute of the file so that it is not visible, you can also add an icon if you want, just add the following line in the above created file.
icon=myicon.ico
Sam HobbsRank #107 · 20.5K reputationPosted Nov 10, 2011, 4:01 PM EST