Introduction to MSDOS

DOS, like UNIX or VMS, is an operating system with a character-oriented or command-line user interface. You can do the same sorts of things in MSDOS as you do in Windows, which has a graphical user interface (GUI).

This is a short summary of MSDOS. It contains only a few of the most useful commands and only shows some of the variations on each. For more detail check the manual or one of the many books or reference Web sites on MSDOS.

Drive Identifiers and File Names

A file name can have three parts, a drive identifier, a name, and an extension, but the drive identifier and extension are optional. The name must be from 1 to 8 characters, and the extension, if any, from 1 to 3 characters. A drive identifier is a letter with a colon, like A: B: C: or M:. There should be no spaces anywhere in the file name. Here are a few examples:

      HOHO
      A:HOHO
      A:HOHO.EXE
Command Summaries

These are the commands you will need to know. In the general forms, the square brackets mean that something is optional.

DIR: Display the directory of files on a disk

     general form:  DIR [ <drive> ] [/W]

     DIR       displays the directory of the default drive
     DIR B:    displays the directory of drive B
     DIR A:    displays the directory of drive A
     DIR /W    displays the directory in "wide" format

TYPE: Display the contents of a disk file
     general form:  TYPE <file name>

     TYPE HOHO      display the file called HOHO on the default drive
     TYPE B:HOHO    display the file called HOHO on drive B
PRINT: Print the contents of a disk file
     general form:  PRINT <file name>

     PRINT HOHO     print the file called HOHO on the default drive
     PRINT B:HOHO   print the file called HOHO on drive B
ERASE (or DEL): Erase a file from a disk
     general form:  ERASE <file name>

     ERASE HOHO     erase the file called HOHO from the default drive
     ERASE B:HOHO   erase the file called HOHO from drive B
RENAME: Change the name of a file
     general form:  RENAME <file name> <file name>

     RENAME HOHO HAHA    change the name of the file called HOHO
                         on the default drive to HAHA
     RENAME B:HOHO HAHA  change the name of the file called HOHO
                         on drive B to HAHA
<program name>: Load and execute the program
     HOHO      load and execute the program called HOHO which
               is on the default drive
     B:HOHO    load and execute the program called HOHO which is
               on drive B
FORMAT: Make a disk ready to use
     general form:  FORMAT <drive> [/S]

     FORMAT B:      initialize the new disk that is in drive B
     FORMAT B:/S    initialize the new disk that is in drive B
                    and put a copy of the operating system on it
COPY: Make a copy of a file
     general form:  COPY <file name> <file name> or
                    COPY <file name> 

     COPY A:HOHO B:HOHO  copy the file called HOHO on drive A to
                         drive B, and call the new file HOHO
     COPY A:HOHO B:      copy the file called HOHO on drive A to
                         drive B, and call the new file HOHO
     COPY A:HOHO B:HAHA  copy the file called HOHO on drive A to
                         drive B, and call the new file HAHA
     COPY HOHO B:        copy the file called HOHO on the default
                         drive to drive B, and call the new file HOHO
MKDIR: Create a sub-directory of the current directory
     general form:  MKDIR 

     MKDIR HAHA     create a directory called HAHA
RMDIR: Remove a sub-directory of the current directory
     general form:  RMDIR 

     RMDIR HAHA     remove the directory called HAHA
CD: Change to a new directory
     general form:  CD 

     CD HAHA        change to the directory called HAHA

Wild cards and path names

You can refer to a group of files using "wild cards." For example:

     DIR *.EXE
will show the names of all files with the extension EXE regardless of the file name:
     DIR *.*
will show the names of all files.

You can also refer to a file in a different directory by specifying the path to it. For example:

     C:\HAHA\HOHO BOB
refers to a file called BOB which is in the directory called HOHO which is a subdirectory of HAHA on drive C.

There are many other MSDOS commands, and, as with any command line interface, there is online reference material. To see a list of commands, type:

     HELP

For help with an individual command, type:

     HELP <command name>

Disclaimer: The views and opinions expressed on unofficial pages of California State University, Dominguez Hills faculty, staff or students are strictly those of the page authors. The content of these pages has not been reviewed or approved by California State University, Dominguez Hills.