Windows – Get Windows to treat files with the same extension differently

file associationfile extensionwindowswindows 7

Multiple programs use the same file extension, but the formats are totally different and incompatible. For instance, I have .sch files on my computer that are in at least 5 different formats (TINA, PSpice, PADS, Protel, and Eagle). Is there a way to get Windows to treat them differently, so that double-clicking on such a file opens it in the program it's meant to be opened in?

Linux uses magic numbers in the files themselves to differentiate, and only uses file extensions as a fallback plan. (All PNG files start with the bytes 89 50 4E 47 0D 0A 1A 0A, for instance, regardless of what you name them.) It would be nice if Windows could support this, but probably very difficult to implement. Maybe something simpler like a second-level extension, like filename.program1.sch and filename.program2.sch? Maybe some kind of filter that renames files on the fly?

Better idea: Associating the ambiguous extension with a pre-processor (.bat file or dedicated app) that checks for a second-level extension or goes into the file itself and scans for the magic number and then launches the appropriate program?

Best Answer

Windows does not launch files based on any information in the file - building a database for that would take an incredible amount of work and programming. The only true way to identify a file is by the binary signatures in the file, if the file even has it, and this is up to the software author to implement.

In Windows, files are passed to the program you specify for a particular file extension. Windows determines a file's extension as the substring which follows the last occurrence of a period, so it's not possible with the file names you posted.

You have to either re-name the files (and give them unique file extensions), or write a batch file to launch the appropriate application for you. For more details, see this Technet article.

Related Question