V22.0201 (sec. 1) - Computer Systems Organization (Honors)

MS-DOS basics

MS-DOS was the original operating system for (IBM) PC's, and served as the base on top of which Windows was originally written.  MS-DOS provided a text-based 'command-line interface' instead of the visual interface of the Mac and Windows.

Some knowledge of this command-line interface is still valuable for running older (MS-DOS) programs, and for writing 'scripts' ... sequences of operating system commands (also called batch or .BAT files).

File names and directory structure

A DOS file can have an 8 character name + an optional 3 character extension.  The extesion is intended to indicate the 'type' of the file.  Most DOS and Windows programs assume some particular extension for the file they use;  Windows uses the extension to associate a particular program with a file.

The files are organized in a tree-structured directory.  An arbitrary file is specified by a path,

The special file name '.' refers to the current directory;  the file name '..' refers to the parent directory.

Long Windows file names are mapped into MS-DOS file names of the form  cccccc~1, cccccc~2, etc.

MS-DOS prompt

To open an MS-DOS window, go to the Windows menu and select  Programs > MS-DOS prompt.

A window will open, with a prompt displaying the current 'working directory'.

MS-DOS commands

To list the files in the current working directory, type DIR.

To change directories, type  CD path  .

To run a program in the current directory,  type  program-name arguments.  DOS will look for a file of the form program-name.EXE, program-name.COM, or program-name.BAT and execute it.

To run a program which resides in a different directory, you can enter the full path of the program.  Alternatively, you can use the PATH command to list the directories in which DOS should look for the program to execute.  The PATH command has the form

PATH  path1;  path2; ...
DOS will search each specified directory in turn for the program to be executed.