Skip to content

The DOS Command Line, Honestly

Outcome: you can drive the shell — look around, read files, copy them, ask what the machine thinks — and you know where this shell's imitation of DOS is faithful and where it quietly stops.

The working set is small. DIR lists a directory (DIR /W for a wide listing, DIR of another path by naming it). CD moves; C: changes drive. TYPE file prints a text file to the screen. COPY a b copies, REN renames, DEL deletes, MD and RD make and remove directories, CLS clears the screen. ECHO prints text — and with > after it, writes text to a file instead, the trick this whole guide's evidence rests on. SET shows the environment; SET NAME=value adds to it. HELP lists the commands the shell supports, and on drive Z:, INTRO gives a guided tour written by the DOSBox team itself.

Redirection and pipes work the way DOS taught: > writes output to a file, >> appends, | hands one command's output to the next. In the lab, dir > C:\CAPTURE\CDIR.TXT captured listings, echo One extra line from the desk >> file appended a line that FreeDOS's FC later found (t05). Output a command prints in red in other guides is, here, in a file you can diff.

Now the honest part. The shell is DOSBox's own, and its fidelity has edges, all of them met by the lab:

  • Some commands are missing. PROMPT — standard since early DOS — answers Illegal command: prompt. (t04). So does anything else the shell never grew: the answer to an unknown word is always that same flat sentence, as the lab's invented frobnicate confirmed (t07).
  • Errors are blunt. A file that is not there is File X not found. — whether X is missing, or its drive was never mounted, or its name is longer than 8.3 and you typed the long form. The shell does not distinguish, so you must: check the mount, check the name, then check the file.
  • Batch files take control. Running a .BAT file hands it the session; when it ends, whatever came after it in a list of startup commands does not run. CALL is the fix, and chapter 8 is built on it.
  • The prompt is fixed. Drive, path, > — always. No setting changes it in this build.

None of this is hidden breakage; it is the documented shape of a small, careful reimplementation. The commands that exist behave the way old hands remember — which is why a real DOS program's own command line, like the FreeDOS tools of chapter 9, feels entirely at home here.