DOS Commands

You should know the following basic DOS commands to be able to complete some of the solutions in this book and get by in the world of Windows.

This, however, should not be considered a comprehensive list of all DOS commands and their options. See Windows XP in a Nutshell (O’Reilly) for a more thorough reference, not only on the Command Prompt, but on all of the various utilities included with Windows XP that use the Command Prompt.

The commands shown here are in constant width, and any parameters (the information you supply to the command) are in constant width italic. It doesn’t matter which case you use when you type them in the command prompt (DOS, like Windows, is not case-sensitive). If there is more than one parameter, each is separated by a space:

attrib attributes filename

Changes the attributes of a file or folder. The four attributes are R for read only, S for system, A for archive, and H for hidden.

In Explorer, you can right-click a file or group of files and select Properties to change the attributes; attrib is the DOS counterpart to this functionality. In addition, attrib lets you change the S (system) attribute, something Explorer doesn’t let you do. Here are some examples:

attrib +h myfile.txt

  • This turns on the H parameter for the file myfile.txt, making the file hidden.

attrib -r "another file.doc"

  • This turns off the R (read-only) parameter for the file another file.doc (note that quotation marks are used because of the space in the filename).

Type ...

Get Windows XP Annoyances for Geeks, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.