Execution Preference
In MS-DOS, if a directory contains both a COM file and an EXE file with same name (not including extension), the COM file is preferentially selected for execution. For example, if a directory in the system path contains two files named foo.com and foo.exe, the following would execute foo.com:
A user wishing to run foo.exe can explicitly use the complete filename:
Taking advantage of this default behaviour, virus writers and other malicious programmers have used names like notepad.com for their creations, hoping that if it is placed in the same directory as the corresponding EXE file, a command or batch file may accidentally trigger their program instead of the text editor notepad.exe.
On Windows NT and derivatives (Windows 2000, Windows XP, Windows Vista, and Windows 7), the PATHEXT variable is used to override the order of preference (and acceptable extensions) for calling files without specifying the extension from the command line. The default value still places .com files before .exe files. This closely resembles a feature previously found in JP Software's line of extended command line processors 4DOS, 4OS2, and 4NT.
Read more about this topic: COM File
Famous quotes containing the words execution and/or preference:
“I am gradually drifting to the opinion that this Rebellion can only be crushed finally by either the execution of all the traitors or the abolition of slavery. Crushed, I mean, so as to remove all danger of its breaking out again in the future.”
—Rutherford Birchard Hayes (18221893)
“Among all the worlds races, some obscure Bedouin tribes possibly apart, Americans are the most prone to misinformation. This is not the consequence of any special preference for mendacity, although at the higher levels of their public administration that tendency is impressive. It is rather that so much of what they themselves believe is wrong.”
—John Kenneth Galbraith (b. 1908)