1

I want to run a program, say a batch file, when any USB mass storage device is connected. I also want to pass the drive letter as a parameter to this batch file.

This can perhaps be achieved using combination of event manager and task scheduler but I don't know how.
I am also open to use third party programs as long as they are free.

I actually know a software that has this capability. But I am looking for a free alternative.

PS: I am running Windows 7 x64 Ultimate

tumchaaditya
  • 3,752
  • 5
  • 41
  • 58

1 Answers1

0

It's quite easy using EventVwr - just right click on the event and click "Attach task to this event". You just need to find the specific event you want. When I plugged an USB mass storage device it triggered the following events (under application category): 20001, 20003, 7036 and a few other less relevant. You just need to test those events against other USB devices events to avoid false positives.

EliadTech
  • 2,184