Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

3 Answers

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, this does not fully answer 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.

share|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

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

share|improve this answer

Try changing the drive letter of the USB flash drive with these instructions: http://www.howtogeek.com/96298/assign-a-static-drive-letter-to-a-usb-drive-in-windows-7/ then use event code 2100. It worked for me.

share|improve this answer
3  
Please add the crucial parts of the link to your answer. This is basically a best practice because of link rot. – Informaficker Aug 28 '12 at 20:04
What good would that do? It's not the drive letter missing causing the problem here, it's the lack of ability to filter on it. – gemisigo Aug 28 '12 at 20:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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