Launching an applicaion on USB attachement

Hi ,

I have an application which I want to invoked when I attached my USB device.

This USB device is requires BulkUsb driver.

My question is can Windows invoke an application exe automatically when I plug the USB?

Can I invoke the exe when my Driver is AddDevice or any other function is called ?

Thanks
Amit S


IndiaInfo Mail - the free e-mail service with a difference! www.indiainfo.com
Check out our value-added Premium features, such as an extra 20MB for mail storage, POP3, e-mail forwarding, and ads-free mailboxes!

As far as I know, there is no way to launch an exe when a device arrives. The standard idiom is to have a process register for notifications of your device interface class, using the RegisterDeviceNotification function. Your device should register one or more interfaces, and these identify the behaviors (contracts) between your device and programs that will use your device. If your device implements one of the well-known device interfaces (whose meaning, I/O control requests, and device interface GUID are documented in the DDK), then you’ll use the existing DDK device interface guids. If your device does something that only your program knows about, then you’ll need to create a new GUID to identify that interface.

In any case, RegisterDeviceNotification is what you want. You can have a system service wait for notifications, and then do whatever you want. Or, you can create a process that runs as the user, in the user’s session/desktop. You “pull” notifications from the PNP manager; the PNP manager does not “push” notifications or run programs on events.


From: xxxxx@lists.osr.com [xxxxx@lists.osr.com] On Behalf Of Amit Shahi [xxxxx@indiainfo.com]
Sent: Wednesday, May 16, 2007 3:18 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Launching an applicaion on USB attachement

Hi ,

I have an application which I want to invoked when I attached my USB device.

This USB device is requires BulkUsb driver.

My question is can Windows invoke an application exe automatically when I plug the USB?

Can I invoke the exe when my Driver is AddDevice or any other function is called ?

Thanks
Amit S


IndiaInfo Mail - the free e-mail service with a difference! www.indiainfo.com
Check out our value-added Premium features, such as an extra 20MB for mail storage, POP3, e-mail forwarding, and ads-free mailboxes!


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

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

Just a word of caution… The other day when doing a patent search I
came across several software patents
regarding this matter (mostly SanDisk if I remember correctly). However,
since I’m not interested in this
type of functionality, I didn’t care to read (or have the time) the
descriptions or claims.

I have no idea how your government views software patents, but a quick
search might guide you away
from various headaches and towards a possible method.

Amit Shahi wrote:

Hi ,

I have an application which I want to invoked when I attached my USB device.

This USB device is requires BulkUsb driver.

My question is can Windows invoke an application exe automatically when I plug the USB?

Can I invoke the exe when my Driver is AddDevice or any other function is called ?

Thanks
Amit S

If the user/admin have disabled Autorun off USB drives - then no ways.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

“Amit Shahi” wrote in message news:xxxxx@ntdev…
Hi ,

I have an application which I want to invoked when I attached my USB device.

This USB device is requires BulkUsb driver.

My question is can Windows invoke an application exe automatically when I plug
the USB?

Can I invoke the exe when my Driver is AddDevice or any other function is
called ?

Thanks
Amit S


______________________________________________
IndiaInfo Mail - the free e-mail service with a difference! www.indiainfo.com
Check out our value-added Premium features, such as an extra 20MB for mail
storage, POP3, e-mail forwarding, and ads-free mailboxes!

Hi Davis ,

Thanks for your suggestion .
I get the clue & try to solve the problem by your suggested way.

Amit S

----- Original Message -----
From: “Arlie Davis”
> To: “Windows System Software Devs Interest List”
> Subject: RE: [ntdev] Launching an applicaion on USB attachement
> Date: Wed, 16 May 2007 04:59:26 -0700
>
>
> As far as I know, there is no way to launch an exe when a device
> arrives. The standard idiom is to have a process register for
> notifications of your device interface class, using the
> RegisterDeviceNotification function. Your device should register
> one or more interfaces, and these identify the behaviors
> (contracts) between your device and programs that will use your
> device. If your device implements one of the well-known device
> interfaces (whose meaning, I/O control requests, and device
> interface GUID are documented in the DDK), then you’ll use the
> existing DDK device interface guids. If your device does something
> that only your program knows about, then you’ll need to create a
> new GUID to identify that interface.
>
> In any case, RegisterDeviceNotification is what you want. You can
> have a system service wait for notifications, and then do whatever
> you want. Or, you can create a process that runs as the user, in
> the user’s session/desktop. You “pull” notifications from the PNP
> manager; the PNP manager does not “push” notifications or run
> programs on events.
>
>
> From: xxxxx@lists.osr.com
> [xxxxx@lists.osr.com] On Behalf Of Amit Shahi
> [xxxxx@indiainfo.com]
> Sent: Wednesday, May 16, 2007 3:18 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Launching an applicaion on USB attachement
>
> Hi ,
>
> I have an application which I want to invoked when I attached my USB device.
>
> This USB device is requires BulkUsb driver.
>
> My question is can Windows invoke an application exe automatically
> when I plug the USB?
>
> Can I invoke the exe when my Driver is AddDevice or any other
> function is called ?
>
>
> Thanks
> Amit S
>
> –
>
______
> IndiaInfo Mail - the free e-mail service with a difference! www.indiainfo.com
> Check out our value-added Premium features, such as an extra 20MB
> for mail storage, POP3, e-mail forwarding, and ads-free mailboxes!
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

>

Amit Rajkumar Shahi
email xxxxx@indiainfo.com

You can’t build a reputation on what you are going to do.
Henry Ford


______________________________________________
IndiaInfo Mail - the free e-mail service with a difference! www.indiainfo.com
Check out our value-added Premium features, such as an extra 20MB for mail storage, POP3, e-mail forwarding, and ads-free mailboxes!

Hi Maxim ,

In my case user/admin will not disable the Autorun off for USB driver.

I have full right on my system & the problem is only this that once I plug my USB device , My exe should be launched automatically from Program or a particular location in my PC.

Thanks
Amit S

----- Original Message -----
From: “Maxim S. Shatskih”
> To: “Windows System Software Devs Interest List”
> Subject: Re:[ntdev] Launching an applicaion on USB attachement
> Date: Wed, 16 May 2007 19:17:01 +0400
>
>
> If the user/admin have disabled Autorun off USB drives - then no ways.
>
> –
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
> “Amit Shahi” wrote in message news:xxxxx@ntdev…
> Hi ,
>
> I have an application which I want to invoked when I attached my USB device.
>
> This USB device is requires BulkUsb driver.
>
> My question is can Windows invoke an application exe automatically when I plug
> the USB?
>
> Can I invoke the exe when my Driver is AddDevice or any other function is
> called ?
>
>
> Thanks
> Amit S
>
> –
>
> IndiaInfo Mail - the free e-mail service with a difference! www.indiainfo.com
> Check out our value-added Premium features, such as an extra 20MB for mail
> storage, POP3, e-mail forwarding, and ads-free mailboxes!
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

>



IndiaInfo Mail - the free e-mail service with a difference! www.indiainfo.com
Check out our value-added Premium features, such as an extra 20MB for mail storage, POP3, e-mail forwarding, and ads-free mailboxes!