Jump to content

Bad command or file name

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 71.29.50.10 (talk) at 05:55, 8 March 2015 (also speculation, but probably correct (original research: message stays v1-6)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Screenshot of the error in MS-DOS

"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."

See also

Notes

  1. ^ Jim Cooper, (2002). Using MS-DOS 6.22. Que Publishing. ISBN 9780789725738
  2. ^ A current example is tclsh with the command "exec nosuchcommand"