By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,688 Members | 1,888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,688 IT Pros & Developers. It's quick & easy.

Trigger/Event when a usb thumb drive is inserted? (vista)

P: n/a
Is there a way to catch an event/trigger that *might* be fired when a
usb thumb drive is inserted into a Vista PC?

The reason I ask is that I'd like to catch that event and back up the
content of the thumb drive to the local machine with a custom process.

I realize there might be some security issues with this...but it would
sure be useful if I could do it.

-Thx

Jun 5 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
<ki*******@gmail.comwrote in message
news:11**********************@n4g2000hsb.googlegro ups.com...
Is there a way to catch an event/trigger that *might* be fired when a
usb thumb drive is inserted into a Vista PC?

The reason I ask is that I'd like to catch that event and back up the
content of the thumb drive to the local machine with a custom process.

I realize there might be some security issues with this...but it would
sure be useful if I could do it.
Look into Autoplay. When the USB drive or CD or other media is inserted a
list of apps appears. You can get your app added to this list and the user
can decide whether to have your app run always or have it as an option. The
WIA sdk that can be downloaded from MS will allow you to easily add your app
to this list.
>
-Thx

Jun 6 '07 #2

P: n/a

"Michael C" <no****@nospam.comwrote in message
news:eu**************@TK2MSFTNGP03.phx.gbl...
<ki*******@gmail.comwrote in message
news:11**********************@n4g2000hsb.googlegro ups.com...
>Is there a way to catch an event/trigger that *might* be fired when a
usb thumb drive is inserted into a Vista PC?

The reason I ask is that I'd like to catch that event and back up the
content of the thumb drive to the local machine with a custom process.

I realize there might be some security issues with this...but it would
sure be useful if I could do it.

Look into Autoplay. When the USB drive or CD or other media is inserted a
list of apps appears. You can get your app added to this list and the user
can decide whether to have your app run always or have it as an option.
The WIA sdk that can be downloaded from MS will allow you to easily add
your app to this list.
Good if you want to run an app for a particular thumb drive being inserted.

If you want to detect *any* removable USB drive, override WndProc and listen
for WM_DEVICECHANGE. You get a DEV_BROADCAST_VOLUME structure which tells
you the drive letter.

http://msdn2.microsoft.com/en-us/library/aa363480.aspx
http://msdn2.microsoft.com/en-us/library/aa363249.aspx
>>
-Thx


Jun 6 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.