Well, in Windows of course, u can tell it what to do when a removable storage is inserted into USB, and one of this option is RUN THIS.
Now Windows notices what kind of removable is this and follows some classifications, I forget the details, meaning, something else pop up when u insert a flash, vs mouse, vs an external DVD player for example.
Assuming you have intercepted the correct trigger and your RUN THIS app is invoked when a flash is inserted, do u want to do the same thing with ANY flash? if not then you need to build in the intelligence into RUN THIS on what to do.