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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I configure my PC to execute a batch file every time any USB drive is inserted? I would like to use regedit, if possible.

share|improve this question

migrated from Jun 6 '11 at 19:40

This question came from our site for professional and enthusiast programmers.

Since you mentioned batch file scripting, I'm going to assume a windows platform. You can write an application that handles these events: WM_DEVICECHANGE

I imagine you can have it running in the background as a daemon and have it call your batch file upon the right conditions.

share|improve this answer

Your Answer


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