Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i make a program run from the computer whenever a usb is plugged in?
01x for any help.
Posted
Updated 7-Jul-10 6:23am
v2
Comments
Shani Natav 7-Jul-10 15:11pm    
Want to copy something when the USB key is plugged in? Some students tried this in my college and got banned
because the copy file screen popped up and they have security cameras :)
In summary it's doable - don't know how...

If you're asking about creating an Autorun.inf file, you can do it for a USB device, however, with Windows, you will always get the "What do you want to do" screen when you plug it in. Windows is set up to not automatically run a file from a USB drive because of security concerns.
 
Share this answer
 
Of course you can for Swing but I'm not sure if it's possible for applets.Note that such solution is most likely to be OS specific.I don't know how to do it under UNIX but under Windows you need to hook WndProc function and listen for WM_DEVICECHANGE.I've done it several times using C++ and MFC.More information is available here.[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900