Checking the magic number is probably the safest (and slowest) method. Also I read somewhere that even "ZM" should work
This is uncertain :
Quote:
and some executables could even start with "PE".
The "PE" chars are inside the header but not in the beginning. In this case "MZ" will be also in the beginning of the file.
As for this... Windows Shell will use "executable" icon for the file as soon as it has '.exe' extensions and tries to execute it on double-click. So what Windows Shell considers good practice is a good practice for me as well...