In this chapter, we will discuss only those commands, switches, and parameters likely to be helpful to those repairing a computer. Because general networking is beyond the scope of Part I of this book, networking commands are excluded. In most command references, there is so much punctuation to
The most basic information is how to accessF commands. Commands can be accessed from the following locations:
MS-DOS Prompt in 9x: Start > Programs > MS-DOS Prompt in 95/98, Start > Programs > Accessories > MS-DOS Prompt in Me. Alternatively, you can type “command” in the Run dialog (Start > Run).
Run dialog (all versions): Start > Run. Many commands are accessible from here.
32-bit Command Prompt (2000/XP): Start > Programs (or All Programs) > Command Prompt or type “cmd” in the Run dialog (Start > Run).
MS-DOS Command Prompt (all versions): Type “command” in the Run dialog (Start > Run).
MS-DOS Prompt from boot (95/98): After booting you’ll automatically get a prompt.
MS-DOS Prompt from boot floppy (all versions): After booting you’ll automatically get a prompt.
Safe Mode Command Prompt Only (Me/2000/XP): After powering on the computer, press <F8> and select Safe Mode Command Prompt only from the boot menu.
Recovery Console (2000/XP): See the instructions in Chapter 11, “Troubleshooting.” The Recovery Console has its own set of commands, most of which are covered in the final section in this chapter.
Not all commands are available in all these places.
Before we get to actual commands, we will provide information that will make it easier to use them. Tutorial 13.1 shows how to select and copy text in a command prompt window.
Tutorial 13.1: Selecting and Copying Text from a Command Prompt Window
Click the icon in the upper left-hand corner of the bar on top of the window, point to Edit in the menu that appears, and click Mark.
Click at the beginning of the text you want to copy.
Press and hold down the <SHIFT> key, and then click at the end of the text you want to copy.
Click the icon again, click Edit, and then click Copy.
Paste the text into a document by holding the <Ctrl> key and pressing <C>, or by selecting Paste from the Edit menu. If you want to paste the text back into the command prompt window, click the icon again, point to Edit, and click Paste.
Wildcard characters can be used when using Windows Search or Find, and to represent multiple files or folders when using a command prompt. Wildcard characters are as
Asterisk (*): Acts as a substitute for zero or more characters. For example, to search for or make a change to any .txt file that starts with G , enter G*.txt . If you want any file that has an extension starting with .tif , enter *.tif . For all files in a particular folder, enter *.* .
Question mark (?): Acts as a substitute for any single character. For example, to search for or make changes to all .doc files that start with Karen followed by a single character, enter karen?.doc . This would find or change karen1.doc , karen2.doc , and so forth, but would ignore karen10.doc because the number 10 has two characters.
When directly editing the MS-DOS configuration files Autoexec.bat and Config.sys, or their XP/2000 counterparts, Config.nt and Autoexec.nt, the safest way to stop a line of text from being implemented is to “comment it out.” In these files, you do this by typing REM at the beginning of a line. This
For .ini files such as Win.ini and System.ini, comment out lines using a semicolon.
For information on commands not listed here, 2000’s and XP’s Help files have lists of all available prompts. Search 2000’s Help for “Command Reference Main Page,” or XP’s for “Command-line Reference.” For 9x’s commands, search the Internet. You can also search Windows’ Help for individual commands.
Not all commands are available in all versions. Additionally, certain MS-DOS commands won’t be available in 2000 or XP if you access the 32-bit command prompt (Start > Programs (or All Programs) > Accessories > Command Prompt), or by typing “cmd” in the Run dialog. However, if you type “command” in the Run dialog, you’ll be able to run some MS-DOS commands that would normally not be available in that version of Windows. Finally, not all commands work as described in Microsoft’s documentation.
For a description and syntax of each command, plus a complete list of switches and parameters, enter the command followed by a space and “/?”. For example, for information about the CD command, type:
Because folders were originally called
, Microsoft uses the
Most of these commands can be used either by entering the full
In addition to the 8.3 limitation of file and folder names in MS-DOS (see Chapter 2, “System Configuration and Computer Hygiene”), there cannot be spaces in MS-DOS file and folder names. When referring to file and folder
Commands, parameters, and switches are not case sensitive.
All switches must be preceded by a space character when typed as part of a single command line. The only time you would omit the space is when you are responding to a prompt, such as is possible in the CHKDSK command.
Press <Enter> after each command to start it.
A great trick that you can use with these commands is use of the < and > keys. < inputs the text from a text file into a command, and > sends the output from a command to a text file. For example, if you use the DIR command with the /p switch and want the output to go to a file in the current folder that you want to name output.txt, type “DIR /p > output.txt”.
If you want to import text from a file into a command, use the < key after the command and switches, followed by the name of the file.
If you find that commands you want to use are not available, running the PATH command might help. This tells the system where to find commands.