Attrib Command

Last Edited

by

in

Definition of Attrib Command in the Network Encyclopedia.

What is Attrib Command?

ATTRIB is a Microsoft Windows command that can be used to display and modify the attributes of files and directories. You can use the attrib command to display and modify the archive, system, hidden, and read-only attributes that can be assigned to files and directories. For example, if you need to manually modify the boot.ini file on a machine running Windows NT, you can use the attrib command to remove its read-only, hidden, and system attributes.

Attrib Command
Attrib Command

Parameters of the attrib command

ParameterDescription
{+|-}rSets (+) or clears (-) the Read-only file attribute.
{+|-}aSets (+) or clears (-) the Archive file attribute. This attribute set marks files that have changed since the last time they were backed up. Note that the xcopy command uses archive attributes.
{+|-}sSets (+) or clears (-) the System file attribute. If a file uses this attribute set, you must clear the attribute before you can change any other attributes for the file.
{+|-}hSets (+) or clears (-) the Hidden file attribute. If a file uses this attribute set, you must clear the attribute before you can change any other attributes for the file.
{+|-}iSets (+) or clears (-) the Not Content Indexed file attribute.
[<drive>:][<path>][<filename>]Specifies the location and name of the directory, file, or group of files for which you want to display or change attributes.
You can use the ? and * wildcard characters in the filename parameter to display or change the attributes for a group of files.
/sApplies attrib and any command-line options to matching files in the current directory and all of its subdirectories.
/dApplies attrib and any command-line options to directories.
/lApplies attrib and any command-line options to the Symbolic Link, rather than the target of the Symbolic Link.
/?Displays help at the command prompt.

Attrib Command example

attrib –r –h –s boot.ini

The above command removes the read-only, hidden, and system attributes from the boot.ini file, allowing you to manually edit the file.

See also:

Search