USING COMMANDS


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

start example
  1. 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.

  2. Click at the beginning of the text you want to copy.

  3. Press and hold down the <SHIFT> key, and then click at the end of the text you want to copy.

  4. Click the icon again, click Edit, and then click Copy.

  5. 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.

end example

Using Wildcard Characters

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 follows:

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.

Comment Indicators

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 tells the system to ignore that line. The advantage to using these indicators as opposed to simply deleting the line is that it’s very easy to reverse if you discover that you erroneously commented out an important line.

For .ini files such as Win.ini and System.ini, comment out lines using a semicolon.

Command Notes

  • 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:

    CD /?
  • Because folders were originally called directories, Microsoft uses the term whenever writing about commands. The two terms (folders and directories) are interchangeable.

  • Most of these commands can be used either by entering the full path of the file or folder being acted upon after the command name, or by navigating to that folder first. In our experience, it is usually easier to navigate to the folder first, eliminating any chance of typos invalidating the command and requiring the command to be retyped. For instructions on navigating to the correct folder, see the description of the CD (CHDIR) command.

  • 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 names containing spaces when using an MS-DOS prompt on Windows, you might need to use quotation marks around the folder or filename. Otherwise, the system might interpret only the first word as the name and anything after that as invalid parameters or switches. This is however, by no means a universal rule, especially in 2000 and XP.

  • 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.




The A+ Certification & PC Repair Handbook
The A+ Certification & PC Repair Handbook (Charles River Media Networking/Security)
ISBN: 1584503726
EAN: 2147483647
Year: 2003
Pages: 390

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net