Start an app when plugging a device

Hi,

I have a device driver and an application that allows me to download the firmware to a USB device and to boot that device. Everything works great except that I would like to start the application automatically when plugging the USB device.

Searching the web and forums only brought examples on how to detect device removal events or articles on autorun for mass storage USB devices.

Is it feasible? If yes how?

Thanks.

Thierry wrote:

I have a device driver and an application that allows me to download
the firmware to a USB device and to boot that device. Everything
works great except that I would like to start the application
automatically when plugging the USB device.

Sounds like you could use a user-mode service that watches for device arrival events, and then triggers an instance of your application for each one. Should be fairly easy to accomplish.

xxxxx@gmail.com wrote:

I would suggest the opposite. I would have your usermode app boot start
and watch per account if need be… Using a service to launch an
app gives the app all the credentials of the system account… Then
again, if your usermode app doesn’t touch a network, never mind (in my
view).

Just something to think about… I wouldn’t consider a service the best
design though.

Matt

Thierry wrote:

> I have a device driver and an application that allows me to download
> the firmware to a USB device and to boot that device. Everything
> works great except that I would like to start the application
> automatically when plugging the USB device.
>

Sounds like you could use a user-mode service that watches for device arrival events, and then triggers an instance of your application for each one. Should be fairly easy to accomplish.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks guys…

I’m a bit surprised by both of your replies… I thought this behavior was something more common and straightforward to implement. I guess I was expecting something like “add a registry key with the path of your application in your inf file”. But of course, my knowledge of Windows system programming is somewhat limited… :wink:

Plugging a digital camera, a scanner or a USB key always seem to trig some events in user space like the execution of your favorite camera application. Is this something implemented in Windows only for certain classes of USB devices?

I guess the trick resides in a user mode service or in a boot start application. So I will take a look at it.

Thanks for your help.