Autorun on USB storage device

M

Mark K Vallevand

I've done some looking, it doesn't look like there is an easy way to
implement an autorun feature on a USB storage device. I'd like to have a
program executed from a USB device when it is plugged in. Has anyone made
something like this work with XPe?

--
Regards.
Mark K Vallevand (e-mail address removed)

Beer is living proof that God loves us and wants us to be happy.
- Benjamin Franklin


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.
 
M

Mark K Vallevand

I just realized that any solution I've played with so far seems to require a
user logged on.
I'd really like to have something that autoruns a program from a USB device
on a headless (no user login) XPe system.
Maybe I'll need to write a program...

--
Regards.
Mark K Vallevand (e-mail address removed)

Beer is living proof that God loves us and wants us to be happy.
- Benjamin Franklin


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.
 
B

Brad Combs

Mark,

I'm not sure if this will help you or not, but I did something similar where
I waited for a USB key to come in and acted. Take a look at the windows
message WM_DEVICECHANGE. You can get the WParam of the message and if it's
DBT_DEVICEARRIVAL then do some work to determine if it's your key that you
wanted to find and if so do something. You can also take a look at the
LParam and if it's DBT_DEVTYP_VOLUME then you can do some work to determine
the vol letter from the volume unitmask.

HTH,
Brad
 
R

Richard

You stated it was a headless target, so you must be trying to perform some
type of automatic update, or automatically grabbing data or log files?

1) If you have a custom shell, you can test if that drive/file exists every
xx amount of time, and if it does then shellexec the file.

2) You can set DUA to search for the drive and run a script if it exists

3) The are some 3rd party "Autoruns" for CD, USB, or whatever you wish to
put them on.

Richard
 
M

Mark K Vallevand

DUA! That's an idea I hadn't thought of. Hmmmm. Thanks.

--
Regards.
Mark K Vallevand (e-mail address removed)

Beer is living proof that God loves us and wants us to be happy.
- Benjamin Franklin


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top