Click here to Skip to main content
15,887,375 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
As the title says:
My concept is: if I plug a usb Drive it will automatically execute a certain command such as to show all the files and folders of the usb drive...
Posted

You have two options:
1. Write a AUTORUN.INF file, like the one you would write for a CD. See http://visualdesigning.com/autorun-usb/[^]; administrators can disable this functionality, but the right-click menu should include the 'autorun' option.

2. Write a misformed .lnk file in the root folder, as described here: http://blogs.technet.com/b/markrussinovich/archive/2011/03/30/3416253.aspx[^]; scroll down to 'The Stuxnet Infection Vector'.

Hope this helps,
Pablo.
 
Share this answer
 
v2
Hello,

You can use autorun feature of Windows OS. Open notepad & copy+paste following code.
[autorun]
open=YOUR_PROGRAM.EXE
icon=YOUR_PROGRAM.EXE, 0
label=YOUR LABEL

Following articles will also help you learn more about this feature.

Regards,
 
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