Bad command or file name explained

"Bad command or file name" is a common and ambiguous error message in MS-DOS.[1]

COMMAND.COM produces this error message when the first word of a command could not be interpreted. Because this word must be the name of an internal command, executable file or batch file,[2] the error message provided an accurate description of the problem, but easily confused novices. The wording gave the impression that filenames provided as arguments to the commands were damaged or invalid. Later, the wording of the error message was changed for clarity. Windows NT displays the following error message instead (where "foo" is replaced by the word causing error):[3]

Some early Unix shells produced the equally cryptic "foo: no such file or directory" again accurately describing what is wrong but confusing users. Most modern shells produce an error message similar to "foo: command not found".[4] [5] [6]

See also

Notes and References

  1. Jim Cooper, (2002). Using MS-DOS 6.22. Que Publishing.
  2. Web site: Instructions. MSDN. 20 February 2014 . Microsoft. March 8, 2015. June 30, 2018. https://web.archive.org/web/20180630214310/https://msdn.microsoft.com/en-us/library/cc750871.aspx. live.
  3. Harry Phillips, Eric Skagerberg, (2002). "New Perspectives on Microsoft Windows 2000 MS-DOS Command Line, Comprehensive, Windows XP Enhanced". Cengage Learning.
  4. Web site: bash - execute_cmd.c . 2022-04-12 . git.savannah.gnu.org . en.
  5. Web site: dash - main.c . 2022-04-12 . git.kernel.org . en . 2022-04-12 . https://web.archive.org/web/20220412213943/https://git.kernel.org/pub/scm/utils/dash/dash.git/tree/src/main.c?id=057cd650a4edd5856213d431a974ff35c6594489#n318 . live .
  6. Web site: zsh - exec.c . 2022-04-12 . GitHub . en . 2022-05-21 . https://web.archive.org/web/20220521092027/https://github.com/zsh-users/zsh/blob/06e5ec914fdedac6446e02c9427a1706dda9c505/Src/exec.c#L763 . live .