"Bad command or file name" is a common error message in Microsoft's MS-DOS and some other operating systems. It is sometimes used as an example of a computer message that is perfectly accurate yet confusing to users.
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, most often, was that the user mistyped a command. The message is extremely confusing if the command line also has some file names, since it makes the user think there is something wrong with them, not with the first word. Recent operating systems changed the error message to be more helpful to users; for instance both OS/2and the Windows NT family output foo is not recognized as an internal or external command, operable program or batch file., where foo is the unrecognized command or nonexistent file.
Some early Unix shells sent the equally cryptic "foo: no such file or directory" to stderror due to a nonexistent file. Most modern shells produce "foo: command not found."