Thursday, December 24, 2009

How do you make a flash drive auto execute a command?

I want to make a prank on a friend but to do it, i need to know how to get a usb flash drive to auto run a command. How does this work?How do you make a flash drive auto execute a command?
There's no really good way to auto-execute a program on a flash-drive. Most flash drives require you to pick a basic action to perform, like open the flash drive or play the media files on it. However, there are ways to include custom actions in the list of available actions. To do this, you'll need to create a file called ';autorun.inf'; on the root level of the flash drive. Heres a simple syntax to follow for this file:





[autorun]


label=WHATEVER_YOU_WANT


icon=some_icon_file.ico





action=Some Name You Want


open=Your_Program.exe





shell\whateveryoupick=%26amp;Some Name You Want


shell\whateveryoupick\command=Your_Pro鈥?br>




The label is what you want to name the flash drive, the icon is an icon file you want the flash drive to display as, the action is the name of the default program on the program list, the open is the path to the program to execute should this action be chosen. The last 2 lines can be modified to add the program to the list.





My suggestion would be to make the prank program look like the ';Open Folder'; program that usually appears by default in the list, that way they may mistakenly execute the malicious program if they are not paying attention. If that doesn't work, you can always have the icon be g*o*a*t*s*e (I can't believe that is considered an expletive) or something like that.

No comments:

Post a Comment