Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
COM file
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Execution preference== In DOS, if a directory contains both a COM file and an [[EXE]] file with same name, when no extension is specified the COM file is preferentially selected for execution. For example, if a directory in the [[Path (variable)|system path]] contains two files named <code>foo.com</code> and <code>foo.exe</code>, the following would execute <code>foo.com</code>: C:\>foo A user wishing to run <code>foo.exe</code> can explicitly use the complete filename: C:\>foo.exe Taking advantage of this default behaviour, [[computer virus|virus]] writers and other malicious programmers have used names like <code>notepad.com</code> 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 (Windows)|<code>notepad.exe</code>]]. Again, these .com files may in fact contain a .exe format executable. On [[Windows NT]] and derivatives ([[Windows 2000]], [[Windows XP]], [[Windows Vista]], and [[Windows 7]]), the {{mono|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 <code>.com</code> files before <code>.exe</code> files. This closely resembles a feature previously found in JP Software's line of extended command line processors [[4DOS]], [[4OS2]], and [[Take Command Console|4NT]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)