A Disk Operation System (DOS) Lesson

The following is a short lesson on DOS to supplement the Introduction to PC Operating Systems class I taught for WVNCC in the Fall of 2000.See if you can answer the questions at the end.

Distilled DOS - - Treatment far too brief, and hopefully not enough to be dangerous�

DOS stands for disk operating system.DOS is a text-based operating system, unlike Microsoft Windows, which is a Graphic User Interface (GUI). DOS requires the user to type commands from the keyboard accurately, and to maintain much more of the directory structure, commands, and their options �in his/her head.�DOS is not visual, the interface is not forgiving of errors, and the error messages are cryptic.It uses far less memory and requires the user to input from the keyboard primarily, rather than the mouse.

DOS commands often take the form of abbreviations for operating system functions, a space, followed by what is called an argument.The argument is the object on which you wish to perform the operating system function.If there is a third part of the DOS command, it is the option switch (es), which are also abbreviations or codes that amplify, restrict or detail how to carry out the function, or on which arguments to carry out the function.The option switch (es) are usually preceded by the forward slash. (/).Often, if no argument or option switch is specified, either an error message will display, or the default arguments and options are employed.The three parts make up the syntax.

When using DOS, some DOS common commands are readily available because they are loaded during the boot process from a single file called COMMAND.COM.Some DOS commands are not so readily available, and the computer must know the directory where they are stored in order to execute them.The way the computer knows how to find the DOS command is by knowing the PATH.Below is a window showing the where the DOS commands are stored on a Windows 95 �based computer. (Scroll down, take a peek & come back.It will look like b&w TV ).The path begins with a drive designator.Just as in Windows, the drive designator for the first floppy drive is A:\ (the backslash is important in DOS).The drive designator for the first Hard Drive is C:\.These drive designators are referred to as the ROOT directories of their respective drives.The DOS equivalent of a folder is a directory.

The default directory displayed when issuing the MS_DOS Prompt command from Windows is C:\WINDOWS>. (Scroll down and look again) In order to change the default directory, I used the �cd� command.�cd� is the abbreviation for �change directory,�and is usually followed by the name of a valid directory, or by some shorthand symbols.In this case, the name of the directory to which I want to go is called �COMMAND,� so from the first DOS command line, I typed:

cdcommand( and then hit the enter key to complete the operating system function )

The computer responded with a change in the DOS command line that reflected the new default directory as:

 C:\WINDOWS\COMMAND>

This is my new default directory.To display the contents of the default directory I used the �dir� (directory) command with no arguments.To employ a wide screen display ( 5 columns) I attached the �/w� option switch, and then hit enter to complete the function.Notice that option switches use the forward slash, whereas directory levels are separated by backslashes.(\=backslash/=forward slash )

So the PATH from window below describes a subdirectory two levels below the root where the DOS commands are kept. (C:\WINDOWS\COMMAND).A backslash represents the root directory and is also placed between each level, or subdirectory, in the path.The files of the directory are displayed, along with some other statistical information.The files in this directory can be very dangerous, and it is not recommended that you attempt to fix any Windows problems with the commands contained herein, unless instructed to do so by some qualified help-desk personnel.If you really want to browse an extensive index of DOS commands try:http://www.csulb.edu/~murdock/easydos.html

http://www.easydos.com/dosindex.html

You may notice that neither the cd nor the dir commands that I employed earlier are listed.They are among the commands loaded upon booting the machine and are kept in memory in the single file called COMMAND.COM, also known as internal commands.The remainder of the lesson will be confined to the relatively safe commands from this group.

The Three Amigos:MD, CD, and RD

MD is the DOS abbreviation for Make Directory, and must be followed by a collection of valid DOS characters that form some name.I don�t know of any option switches for this command, but some name must follow it.The Windows equivalent is FILE-New-Folder.The directory from which you issue this command becomes the parent directory and is the immediate superior to the new directory in the PATH or hierarchy. The hierarchy goes from general to specific For example:

If the current default directory is A:\Students, and you issue the command MD, followed by a space, then the directory name �Red�, the path leading to the new directory would be A:\Students\Red. However, the default directory remains the parent, Student.In order to change the default directory, you must use the cd or change directory command, followed by the name of the directory, in this case, Red. (cdRed)

Once there, you can return to the parent level, Students, by typingcd..Do you member a reference to shorthand symbols above?The dual periods after the cd command have the effect of the up folder on the Explorer bar in Windows. 

What are the steps to make another directory and call it Blue?

Using the dir command would display the current directory andconfirm both Red and Blue subdirectories. 

It is from the parent directory that you must perform the rd commandthat will erase the Red directory.Remove Directory, get it? Type rdRed, and in the absence of an error message, assume Red is erased.Type cls to clear the screen.The cls command is employed frequently: it doesn�t make any changes to the system other than to reset the monitor display.

Directories ( Folders ) are named areas of the disk where files are classified and stored.The files contain the information or carry out programs and functions.Directories are navigated using the cd command and its arguments.Files are moved and copied and deleted.The RD command removes directories, but the DEL or ERASE commands are used to delete files, and there is no Recycle Bin.There is an UNERASE command, but we�d just as soon not go there.

 DOS filenames are short (< 8 characters) words, a period, and three-letter extension. The extension classifies the file and determines if it is executable. An executable file in DOS usually ends in .exe , .com, or .bat, but you don�t always have to type the extension with the command.

The COPY command arguments are the object file, followed by the destination directory and filename. Two files of the same name cannot be stored in the same directory:One of these factors must differ.Either put it somewhere else or call it something else when copying or naming files.The exception is when you wish to overwrite or update an existing file. If you want to copy multiple files, you can copy a group of files that meet some criteria or pattern. Using the global wildcard, the ASTERISK (*.*), you can do a global copy of all the files in a given directory.The syntax for the command would look like:copy*.*a:\BlueThe asterisk symbols may stand for any number of characters, and one each is used for file name and extension.The question mark (?) is also a wildcard, and may stand for single characters in filenames.

DOS is a quick, agile operating interface that is demanding of the user and does not make use of the computer multimedia, multitasking, megafile environment.It is often used in troubleshooting and maintenance.procedures.You may never have to access the DOS prompt on your Windows computer.If you do, do so with caution.

1.The DOS command for creating a directory is________.

2.The DOS command for navigating from one directory to another is ______.

3.The DOS command for displaying the content of the default directory is _____.

4.The DOS command for clearing the screen of the display is ______.

5.The DOS command for duplicating a file to another directory or disk is _____.

6.The DOS �wildcard� character that may replace a single character is the ______ .

7.The DOS �wildcard� character that may replace any number of characters is the ______ .

8.DOS filenames are limited to ______characters and a three-letter extension.

9.The _______used in the DOS command line to designate the root directory and is also placed between levels of subdirectories in the path.

10.The DOS command for removing a file from the disk is __________.

MD

CD

DIR

CLS

COPY

?

*

8

BACKSLASH

DEL OR ERASE