How to change the file's attributes using the Attrib command

In Windows, file attributes are settings associated with files on a computer that grant or deny certain rights to users or operating systems associated with accessing that file. The following article will show you how to change the properties of any file using attrib command in Command Prompt.

In Windows, file attributes are settings associated with files on a computer that grant or deny certain rights to users or operating systems associated with accessing that file. The following article will show you how to change the properties of any file using attrib command in Command Prompt.

How to change the file's attributes using the Attrib command Picture 1How to change the file's attributes using the Attrib command Picture 1

Types of file attributes

First, we need to know what kind of attributes a computer file can carry. With Windows operating systems, there are four traditional types of file attributes:

- Read-only : Can read, but cannot change or delete;

- Hidden : By default will not be displayed in the list of files located in the directory;

- Archive : Used to selectively back up or copy files;

- System : Mark important system files, necessary to the computer operating properly (by default will be hidden even if you unhide the files Hidden ).

In the new versions of Windows, many types of file attributes have been updated, such as Encrypted , Not Content-Indexed , Offline , etc. However, for general users, most of those attribute types are never used. use in this article I will not mention.

Instructions to change the properties of the file with the attrib command

Each type of file attribute has a unique symbol. Before using the command to change file attributes, you need to know the symbol that corresponds to each attribute type:

- Read-only with symbol R;

- Hidden with symbol H;

- Archive with the symbol A;

- System has the symbol S.

Then you proceed to change the properties of the file according to the following steps:

Step 1: Open Command Prompt (can use the Search feature , search by keyword "cmd", right-click on the Command Prompt result and select Run as administrator ).

How to change the file's attributes using the Attrib command Picture 2How to change the file's attributes using the Attrib command Picture 2

Step 2: Use attrib command to change the properties of the file.

* To add an additional attribute to the file, enter the following command and press Enter :

attrib +

Inside:

- Attribute symbol : A symbol corresponding to the attribute you want to add to the file;

- Path of the file : The full path to that file.

For example, add the Hidden attribute as follows:

How to change the file's attributes using the Attrib command Picture 3How to change the file's attributes using the Attrib command Picture 3

* To cancel an existing property of the file, enter the following command and press Enter :

attrib -

For example, cancel the Hidden property :

How to change the file's attributes using the Attrib command Picture 4How to change the file's attributes using the Attrib command Picture 4

* The attrib command can also change multiple properties at once for a file.

For example, cancel both Hidden and Read-only properties simultaneously :

How to change the file's attributes using the Attrib command Picture 5How to change the file's attributes using the Attrib command Picture 5

* You can also use the attrib command to see what properties a file has:

attrib

The symbols in the resulting line indicate the properties of the file.

How to change the file's attributes using the Attrib command Picture 6How to change the file's attributes using the Attrib command Picture 6

Through the article above, I showed you how to change the properties of the file with the attrib command . Hope that the information just shared above will be helpful for you!

5 ★ | 1 Vote