Bad command or file name

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Bad command or file name.PNG

"Bad command or file name" is a common error message in Microsoft's MS-DOS and some other operating systems.[1]

In, the message "Bad command or file name" is produced if the user mistypes the first word of a command line. 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. Novices, in general, had trouble understanding the message, so later operating systems changed it; for instance, OS/2 and the Windows NT (and newer) family use "<typed-in string> is not recognized as an internal or external command, operable program or batch file."

Some early Unix shells produced the equally cryptic "<typed-in string>: no such file or directory"[2] (because they searched for a file matching the command name and this is the strerror when a file of a given name is not found). Most modern shells produce "<typed-in string>: command not found."

See also[edit]


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