CTEC1863 MS-DOS Crash Course Page 1 of 3
MS-DOS CRASH COURSE
(Adapted from "Windows Annoyances" by David A. Karp, O'Reilly & Associates,
1997.)
At least one lab in this course requires that you type commands into a DOS window. If you don't quite have a
grasp on this concept, here's a crash course on MS-DOS (short for Microsoft Disk Operating System). DOS has been
included with PCs since the original IBM 5150 PC in the early 1980s, and even the newest PCs still use it to some
extent. DOS was the PC operating system used before Microsoft Windows became the standard and still has some
use today. All versions of Microsoft Windows from 1.0 to 3.11 relied on DOS. Windows was thought of only as an
extension, as one needed to load DOS before starting Windows. Windows 95, 98 and ME were still based
somewhat on MS-DOS for compatibility with the vast majority of available software and Microsoft has made
Windows NT, 2000, XP, 2003, 2008, Vista, and 7 completely independent of MS-DOS, but still makes available the
command prompt for those who need the functionality.
Rather than unloading Windows to access the command prompt, you simply load another command prompt while
remaining in Windows. This is often referred to as a “DOS box” or “DOS window.” If you don't have a Command
Prompt item in your Start Menu, you can use the Start Menu's Run command or search box to execute cmd.exe
(or command.com on older versions of Windows).
You'll see a window that looks like the one shown below in Fig. 3. The cursor indicates the command line (where
commands are typed), and the prompt usually shows the current working directory (here, C:Userscampus).
To run programs in a DOS box, type the name of the program at the command line (also called the C prompt
because it usually looks like C:>) and press Enter. You should know the following basic DOS commands. The
commands and the parameters (the information you supply to the command) can be in either uppercase or
lowercase (or both.) If there is more than one parameter, each is separated by a space.
Figure 2. Windows 7 Start Menu
Figure 1. Type "cmd" in Windows
7 search box.
CTEC1863 MS-DOS Crash Course Page 2 of 3
Figure 3. Typical Windows 7 Command Prompt Window
CD foldername
Changes the working directory to foldername. If the prompt indicates that you are in C:Windows, and
you want to run a DOS program located in C:Files, type CD C:FILES. Typing CD by itself will tell
you the current working directory, i.e., where you are at the moment, although the prompt shows that
already. Use CD /D drive:foldername to also change the current drive.
DIR
Displays a listing of all the files and directories in the current working directory. Use CD to
change to a different directory. Type DIR C:FILES to display the contents of C:Files
without using the CD command. Type DIR /? for additional options.
ATTRIB filename
Changes the attributes (also called properties) of a file. In Explorer, you can right-click on a file or group
of files to change the attributes (R for read only, S for system, A for archive, and H for hidden). ATTRIB is
the DOS counterpart to this functionality. In addition, ATTRIB lets you change the S attribute -- something
Explorer doesn't let you do. Here are some examples:
o ATTRIB +H MYFILE.TXT -- This turns on the "H" parameter for the file myfile.txt.
o ATTRIB -R "ANOTHER FILE.DOC" -- This turns off the "R" parameter for the file another
file.doc (note the quotes used because of the space in the filename).
o Type ATTRIB /? for additional options.
COPY filename destination
Copies a file to another directory or drive, specified as destination. This is the same as dragging and
dropping files in Explorer, except that the keyboard is used instead of the mouse. For example, to copy
the file myfile.txt (located in the current working directory) to your USB flash drive, type COPY
MYFILE.TXT E:.
XCOPY source destination
Copies a file or a whole directory to another directory or drive, specified as destination. This is the same
as dragging and dropping folders in Explorer. XCOPY is much more flexible and powerful than COPY. For
example, to copy the directory files and all its subdirectories (even empty ones) to your network drive,
type XCOPY FILES W:FilesBackup /E /I. Type XCOPY /? for additional options.
CTEC1863 MS-DOS Crash Course Page 3 of 3
MOVE filename destination
The same as COPY, except that the file is moved instead of copied.
REN oldfilename newfilename
Renames a file to newfilename. This is especially useful, as you can use the REN command to rename
more that one file at once -- something Explorer doesn't let you do. For example, to rename myfile.txt to
herfile.txt, type REN MyFile.txt HerFile.txt. To change the extensions of all the files in the
current working directory from .TXT to .DOC, type REN *.TXT *.DOC.
DEL filename
Deletes a file. For example, to delete the file myfile.txt, type DEL MYFILE.TXT. This is not the same as
deleting a file (with the mouse) in Windows, as the file will not be stored in the Recycle Bin. The Windows
equivalent is to hold down the Shift key while deleting a file with the mouse.
EXIT
Closes the command prompt window. In most situations, you can just click the close button at the
upper right corner of the window, but the EXIT command is safer, because it means that no other DOS
command is currently running.

Msdos crash course

  • 1.
    CTEC1863 MS-DOS CrashCourse Page 1 of 3 MS-DOS CRASH COURSE (Adapted from "Windows Annoyances" by David A. Karp, O'Reilly & Associates, 1997.) At least one lab in this course requires that you type commands into a DOS window. If you don't quite have a grasp on this concept, here's a crash course on MS-DOS (short for Microsoft Disk Operating System). DOS has been included with PCs since the original IBM 5150 PC in the early 1980s, and even the newest PCs still use it to some extent. DOS was the PC operating system used before Microsoft Windows became the standard and still has some use today. All versions of Microsoft Windows from 1.0 to 3.11 relied on DOS. Windows was thought of only as an extension, as one needed to load DOS before starting Windows. Windows 95, 98 and ME were still based somewhat on MS-DOS for compatibility with the vast majority of available software and Microsoft has made Windows NT, 2000, XP, 2003, 2008, Vista, and 7 completely independent of MS-DOS, but still makes available the command prompt for those who need the functionality. Rather than unloading Windows to access the command prompt, you simply load another command prompt while remaining in Windows. This is often referred to as a “DOS box” or “DOS window.” If you don't have a Command Prompt item in your Start Menu, you can use the Start Menu's Run command or search box to execute cmd.exe (or command.com on older versions of Windows). You'll see a window that looks like the one shown below in Fig. 3. The cursor indicates the command line (where commands are typed), and the prompt usually shows the current working directory (here, C:Userscampus). To run programs in a DOS box, type the name of the program at the command line (also called the C prompt because it usually looks like C:>) and press Enter. You should know the following basic DOS commands. The commands and the parameters (the information you supply to the command) can be in either uppercase or lowercase (or both.) If there is more than one parameter, each is separated by a space. Figure 2. Windows 7 Start Menu Figure 1. Type "cmd" in Windows 7 search box.
  • 2.
    CTEC1863 MS-DOS CrashCourse Page 2 of 3 Figure 3. Typical Windows 7 Command Prompt Window CD foldername Changes the working directory to foldername. If the prompt indicates that you are in C:Windows, and you want to run a DOS program located in C:Files, type CD C:FILES. Typing CD by itself will tell you the current working directory, i.e., where you are at the moment, although the prompt shows that already. Use CD /D drive:foldername to also change the current drive. DIR Displays a listing of all the files and directories in the current working directory. Use CD to change to a different directory. Type DIR C:FILES to display the contents of C:Files without using the CD command. Type DIR /? for additional options. ATTRIB filename Changes the attributes (also called properties) of a file. In Explorer, you can right-click on a file or group of files to change the attributes (R for read only, S for system, A for archive, and H for hidden). ATTRIB is the DOS counterpart to this functionality. In addition, ATTRIB lets you change the S attribute -- something Explorer doesn't let you do. Here are some examples: o ATTRIB +H MYFILE.TXT -- This turns on the "H" parameter for the file myfile.txt. o ATTRIB -R "ANOTHER FILE.DOC" -- This turns off the "R" parameter for the file another file.doc (note the quotes used because of the space in the filename). o Type ATTRIB /? for additional options. COPY filename destination Copies a file to another directory or drive, specified as destination. This is the same as dragging and dropping files in Explorer, except that the keyboard is used instead of the mouse. For example, to copy the file myfile.txt (located in the current working directory) to your USB flash drive, type COPY MYFILE.TXT E:. XCOPY source destination Copies a file or a whole directory to another directory or drive, specified as destination. This is the same as dragging and dropping folders in Explorer. XCOPY is much more flexible and powerful than COPY. For example, to copy the directory files and all its subdirectories (even empty ones) to your network drive, type XCOPY FILES W:FilesBackup /E /I. Type XCOPY /? for additional options.
  • 3.
    CTEC1863 MS-DOS CrashCourse Page 3 of 3 MOVE filename destination The same as COPY, except that the file is moved instead of copied. REN oldfilename newfilename Renames a file to newfilename. This is especially useful, as you can use the REN command to rename more that one file at once -- something Explorer doesn't let you do. For example, to rename myfile.txt to herfile.txt, type REN MyFile.txt HerFile.txt. To change the extensions of all the files in the current working directory from .TXT to .DOC, type REN *.TXT *.DOC. DEL filename Deletes a file. For example, to delete the file myfile.txt, type DEL MYFILE.TXT. This is not the same as deleting a file (with the mouse) in Windows, as the file will not be stored in the Recycle Bin. The Windows equivalent is to hold down the Shift key while deleting a file with the mouse. EXIT Closes the command prompt window. In most situations, you can just click the close button at the upper right corner of the window, but the EXIT command is safer, because it means that no other DOS command is currently running.