2 exact copies of autorun.inf, one works one doesnt

19

I have two Autorun.inf files, the code inside them are exact same. But only 1 works, other one doesn't work.

The one that work is copied from DVD, and i edited it. The one that doesn't work created on my desktop by renaming text file ( i correctly renamed it ).

This one works

enter image description here

This one doesn't work

enter image description here

If you want the files :

Working one : http://www16.zippyshare.com/v/64IutSu4/file.html

Not working one : http://www98.zippyshare.com/v/zEqU2BZ7/file.html

Does anyone know why doesn't the one i created on my desktop wont work? and how can i get it working? and whats the difference between those 2 file?

Thanks.

user4335407

Posted 2016-02-16T01:03:31.477

Reputation: 235

Question was closed 2016-02-16T22:51:04.323

I opened both with a hex editor and they are quite different when looking at the hex values. Its easy enough to make a new one. Make a Autorun text file and type in the data, save the file and change the extension from txt to inf. – Moab – 2016-02-16T01:21:06.767

@Moab That's what i did but i saved it as "UTF-8 with an UTF-8 BOM" - (dxiv) and that was the issue. Thanks for the response :) – user4335407 – 2016-02-16T02:05:16.923

1I would dissagree in them beeing exact copies. This is simply impossible IF they are. – Zaibis – 2016-02-16T14:46:30.787

The first file says "usb". The second file says "usbk". Look at the last lines. Seems like a simple typo. – ApproachingDarknessFish – 2016-02-16T22:17:05.293

Answers

35

The 2nd .inf, which doesn't work, appears to have been saved as UTF-8 with a UTF-8 BOM.

The UTF-8 BOM means that the file starts with the binary sequence EF BB BF (in hex). But Windows expects autorun.inf files to be plain text, so it won't recognize this one as such.

My advice is to choose the plain-text option in your text editor when saving .inf files or similar.

dxiv

Posted 2016-02-16T01:03:31.477

Reputation: 1 784

2and this is why you do not use notepad for editing program files. – Thorbjørn Ravn Andersen – 2016-02-16T08:17:30.277

4@ThorbjørnRavnAndersen i dont think notepad adds BOM. – Sharky – 2016-02-16T08:22:25.383

1It doesn't, but it doesn't tell you about BOM either, and it will save it back in the same encoding as the original file. – Nelson – 2016-02-16T12:11:12.193

1UTF8 is plain text. I presume that you are talking about ASCII. – fNek – 2016-02-16T15:33:01.697

1@fNek UTF-8 is a variable-length (multi-byte) encoding. In this context, plain text referred to a single-byte encoding, commonly 7-bit ASCII. I guess 8-bit extended ASCII might be interpreted in the default Windows codepage and work, too, though I did not verify it and couldn't find it documented. – dxiv – 2016-02-16T16:42:13.060

2It's not even the variable-length encoding that is the problem. It's that the "BOM" (which isn't really a BOM at all, because a BOM is only used to distinguish little-endian from big-endian encodings of 16-bit or larger Unicode) is not visible inside the editor. And the invisibility of the "BOM" is what makes it no longer plain text. – Monty Harder – 2016-02-16T19:59:36.587

UTF-8 text is plain-tet, just like @fNek said. If you mean ASCII instead, say so. – Deduplicator – 2016-02-16T20:41:44.940

@Deduplicator I did not mean that UTF-8 encoded text would not be text. Of course it is. But, as I already clarified in my previous comment, in this context plain text referred to 7-bit ASCII or possibly 8-bit codepage encoding. While not rigorously precise, calling it plain text is rather common usage in Windows world. For example, if you run MS Word and Save-As a file, one format available is plain text, which defaults to the active ANSI codepage. – dxiv – 2016-02-17T05:57:15.120

@dxiv: The default encoding for plain-text on windows is active ANSI codepage, and MS doesn't and won't support unicode as the ANSI-codepage, sure. But that doesn't change the fact that you can select UTF-8 without MS BOM there, and it's still plain-text. – Deduplicator – 2016-02-17T16:15:12.533

32

As dxiv has said, this is caused by UTF-8 BOM.

The file editor you are using, Notepad++, can tell you the encoding of the file.

enter image description here

UTF-8 BOM adds header bytes to the file that breaks their compatibility with standard ASCII files, whereas UTF-8 without BOM (or just plain UTF-8) files are fully reverse compatible with standard ASCII file, assuming you do not use any UTF-8 characters.

Notepad++ also has a HEX editor plugin and you will be able to see these extra bytes with it:

enter image description here

Nelson

Posted 2016-02-16T01:03:31.477

Reputation: 1 199