Search my blog
Custom Search

2015/02/05

Autorun.inf with UTF-8 BOM is not recognized by windows autoplay/autorun

Issue:
 
When I create a Autorun.inf for a CD-ROM, Win 7 won't automatically "run" the setup.exe.
 
My sample autorun.inf:
[autorun]
action=Autorun
open=Setup.exe
icon=Setup.exe,0
label=XXX Install CD
 
 
Troubleshooting:
 
First I have confirmed that nothing is wrong with my Win 7. The autorun is not disabled. For all related registry settings, please refer to this WIKIPEDIA article:
 
 
After the registration are confirmed that AUTORUN is enabled, I still cannot make the "setup.exe" run. Win 7 only prompts to "Open Files" as below.

 
Cause:
 
I noticed that the ICON and the label are not shown as expected as well. Then I doubt if something is wrong with the autorun.inf file.
 
I checked the encoding of autorun.inf and found it's encoded in UTF-8 with BOM (default by my vim settings).
 
After I change the encoding to ACSII, the autoplay/autorun finally starts working.
 
 
Conclusion:
 
Windown 7 autoplay/autorun cannot handle autorun.inf file in UTF-8 with BOM.