I know it has been discussed before several times that it is not possible to start an application from an usb drive when connecting it due to limitations of autorun (or autoplay??) in Win 7. But it is possible to create a scheduled task having On an event type trigger and surely there must be an event occurring when the drive is connected.

Does anybody have the slightest idea which Event ID should I use? Or at least what type of event? There are too many logs to pick from.

link|improve this question
feedback

2 Answers

Try Log: System, Source: Service Control Manager, Event ID 7036. It seems to work for me but there is sometimes a delay of 1 to 2 minutes.

Edit Just noticed Event ID 7036 occurs occasionally after initially plugging in a usb drive, so its probably not a solution. Sorry

link|improve this answer
feedback

As I already explained on this discussion (but it was about running a program when a USB drive is removed), USB Safely Remove, although not free, can run a program when some events about USB devices are triggered:

Another USB Safely Remove feature that distinguishes it from similar software is starting any applications not only after connecting a device, but also before removing it. The autorun feature allows you to set up data backup before disconnecting a removable hard drive, to run Total Commander with the contents of the pen-drive, automatically unmount an encrypted TrueCrypt drive before disconnecting the USB media, etc.

enter image description here

Of course, it does not fully reply the question, as it is not about using scheduled tasks, but the goal is the same, I think, which is to run a specific program when a USB stick is plugged in.

link|improve this answer
Thank you very much, a good workaround, it is. I've tried it but in spite of it working properly, I'm still trying to achieve my original goal (that is, using a natively available and free solution). So far I've figured out that using Event ID 2006 events from DriverFrameworks-UserMode I can trigger the action. It's still not perfect though. The necessary info is available in the event details but I cannot filter it for a specific USB drive, so plugging in any USB drive will cause the trigger to fire. – gemisigo May 26 '11 at 10:37
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.