Setting File Attributes

Each DOS file has attributes that define the properties of the file. You can manipulate these attributes by using the ATTRIB command. The four DOS attributes are described below.

Attribute

Purpose

read-only (R)

If you set the read-only attribute, you cannot modify or delete a file unless you remove the read-only attribute. This attribute safeguards a file from being accidentally modified or deleted.

archive (A)

You use the archive attribute with backups. A file that is marked with the archive attribute indicates that it is a new file or a file that has been modified since the last backup. Use this attribute when you perform incremental or differential backups.

system (S)

The system attribute indicates that the file is a system or program file. To manipulate any of the other attributes, you must first remove the system attribute. This attribute implies that a file is read-only.

hidden (H)

The hidden attribute keeps a file from being listed through the DIR command or from being accidentally deleted.

incremental backup

Uses the archive bit to determine which files have changed since the last incremental backup. After the incremental backup is complete, the archive bit is cleared. Incremental backups occur between each normal or full backup.

differential backup

Uses the archive bit to determine which files have changed since the last normal backup. Files that have changed are backed up. The archive bit is not reset until the next normal backup. If you have to restore data, you need only your last full backup and your last differential tape.

The syntax for the ATTRIB command is

ATTRIB drive letter:\directory\file [+attribute|-attribute] 
  • +attribute indicates that you are applying an attribute.

  • -attribute indicates that you are removing an attribute.

  • Note that you type only the letter abbreviation of the attribute, such as H for the hidden attribute.

Assume that you have a directory, D:\TEST, and that the directory contains a file called TEST.DOC.

To see the file attributes, you would type ATTRIB TEST.DOC and press Enter.

click to expand

Note that the A in front of the filename indicates that the archive bit is set. This attribute is applied to all new files.

To apply the hidden attribute to the TEST.DOC file, you would type ATTRIB TEST.DOC +H and press Enter.

click to expand

To remove the hidden attribute from the TEST.DOC file, you would type ATTRIB TEST.DOC -H and press Enter.

click to expand




MCSA. MCSE 2003 JumpStart. Computer and Network Basics
MCSA/MCSE 2003 JumpStart
ISBN: 078214277X
EAN: 2147483647
Year: 2003
Pages: 203
Authors: Lisa Donald

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