Bad command or file name
This article needs additional citations for verification. (February 2015) |
![]() | This article possibly contains original research. (March 2015) |
"Bad command or file name" is a common error message in Microsoft's MS-DOS and some other operating systems.[1] It is sometimes used as an example of a computer message that is perfectly accurate yet confusing to users[citation needed].
COMMAND.COM produced the message "Bad command or file name
" when the user mistyped the first word of a command. This first word must be either the name of a built-in "command", or of an executable file or batch file. Therefore the error was printing what, to the programmer, was an accurate description of the problem: there was no such command and there was no such file. However the actual problem was usually due to a mistyped command. The message became more confusing if the user had input file names because the wording of the error could have led the user to believe the input files were damaged or that the names of the files were illegal. The wording of the error message displayed to the user was changed in later operating systems; for instance, both OS/2 and the Windows NT family output foo is not recognized as an internal or external command, operable program or batch file.
, where foo
is the first mistyped word.
Some early Unix shells produced the equally cryptic "foo: no such file or directory
"[2] for the same reasons. Most modern shells produce "foo: command not found
."