WINDOWS 2000 PROFESSIONAL

SET FILE ATTRIBUTES WITH THE ATTRIB COMMAND

You're probably familiar with file attributes, which determine the characteristics of a file, including the read-only, compressed, and hidden attributes.

Most of the time, the Windows GUI is the easiest and most direct method for viewing and changing a file's attributes. Right-click the file, and choose Properties. Windows displays the Hidden and Read-only attributes on the General tab, and you can click Advanced to view compression and encryption attributes.

However, the ATTRIB command is a more effective approach in some situations, such as when you need to change attributes for several files or change attributes within a script. Typing ATTRIB without any parameters displays all of the files in the current folder and their attributes. To view the attributes of a specific file, add the filename after the ATTRIB command, as shown below:

ATTRIB MYFILE.DOC

You can use a handful of parameters with ATTRIB to set a file's attribute. For example, use the following command to add the Read-only attribute to Myfile.doc and to remove the Hidden attribute:

ATTRIB +R -H MYFILE.DOC

To learn more about the ATTRIB command and its parameters, enter HELP ATTRIB at the command prompt.