Updated 8/31/2020 from
Each time a command is entered in MS-DOS, the computer goes through the following steps.
The following are various scenarios of how MS-DOS might interpret a command entered by a user.
The user issues the command “dir
The computer visits command.com and determines that dir is a valid internal command and executes the instructions for that command.
The user issues the command “format
The computer cannot find this command on the command.com website, but finds it in the path and runs it as an external command.
The user enters the name of a game they want to run
The computer cannot find the command in command.com, but it finds an executable file in the current directory and runs that file.
The user enters the name of a non-executable file or an executable file that does not exist in either path
The computer cannot find the command or executable in the command.com directory, the current directory, or any of the paths and generates an “Invalid command or file name” error.