How to make autorun.inf file?
By lovedude
@lovedude (4447)
India
December 25, 2011 11:20pm CST
I want to run specific program when someone double click on my folders or try to access my USB.. I have make batch file to run with that .inf file.. now when I am trying to make autorun.inf file.. it doesn't execute automatically.. I have written syntax as :
[autorun]
open=myfile.bat
but it doesn't work. can anyone help me with this??
2 responses
@dollar3235 (2062)
• India
26 Dec 11
Hi lovedude,
Follow these steps:
1. Open Notepad, copy and paste the following:
[autorun]
open=myfile.bat (or the full path of the myfile.bat file on the thumb drive)
2. Save the Notepad file with the following options:
File Name: filename.inf
Save as type: All files
3. Save it in your thumb drive with the myfile.bat file and it will work, if it
doesn't work, remove the thumb drive and reconnect it, it will certainly work.
For more details, check this one:
http://msdn.microsoft.com/en-us/library/aa969327.aspx
@dollar3235 (2062)
• India
26 Dec 11
You can also add an icon for your thumb drive, if the icon appears as expected, you will come to know that the problem is with the myfile.bat file and not with the autorun.inf file.
Using an icon in autorun.inf file also helps you detecting a virus infection on your thumb drive, if the thumb drive is infected, the autorun.inf file will be replaced by the virus and the icon will not appear on the thumb drive. 

@owlwings (43897)
• Cambridge, England
26 Dec 11
I have never written an autorun.inf file but, reading the article here: http://msdn.microsoft.com/en-us/library/aa969327.aspx it appears that an 'action' key would be required for a drive of type DRIVE_REMOVABLE.
I doubt very much that an autorun.inf file can be used in the way you appear to describe, in other words, to protect a folder from being opened. The autorun.inf file is designed to specify what action is automatically performed when the drive is mounted.
You may also find the following pages useful: http://autorun.moonvalley.com/autoruninf.htm and http://www.ashzfall.com/products/autorun/ Many of the descriptions published seem to be aimed mainly at autorun for CD drives. USB drives may require special considerations in some cases.



