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.

How 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 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 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 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 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 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

May be interested

  • How to Change File DatesHow to Change File Dates
    when a file is created on a computer, it is automatically given a set of attributes. these attributes include the date, size and file format. however, file dates may occasionally need to be changed. windows 8, windows 10 and mac are the...
  • Change all file extensions in a Folder with the CMD commandChange all file extensions in a Folder with the CMD command
    instead of using supporting software, or changing the tail with f2 key, you just need to use the simple command in cmd to be able to change a series of files in the same folder.
  • Style HTML with CSSStyle HTML with CSS
    css is added to html elements in three ways: inline, internal and external.
  • The Cat command in LinuxThe Cat command in Linux
    the cat command (short for 'concatenate') is one of the most frequently used commands in operating systems like linux / unix. the cat command allows users to create one or more files, view file contents, join files, and redirect output in a terminal or file.
  • How to Change Directory in Command PromptHow to Change Directory in Command Prompt
    this article shows you how to change folders in the command prompt program on a windows computer. to change commands in command prompt, you must use an administrator account.
  • The cipher command in WindowsThe cipher command in Windows
    the cipher command displays or changes the encryption of folders and files on ntfs volumes. if used without parameters, the cipher command displays the encryption status of the current directory and any files that contain it.
  • Tricks to change Command Prompt background color on WindowsTricks to change Command Prompt background color on Windows
    if you want to change the background color of command prompt to make it easier to see, you can. in the article below, network administrator will guide you through the steps to change the color of command prompt on windows.
  • How to HIDE / SHOW files and folders by cmd command on Win 10/8/7How to HIDE / SHOW files and folders by cmd command on Win 10/8/7
    instructions on how to hide / show files or folders by command in command prompt. the trick to hide files with the cmd command on windows operating systems is extremely fast
  • How to change the folder in Command Prompt on Windows 10How to change the folder in Command Prompt on Windows 10
    one of the first things you need to learn when you become more familiar with the command prompt on windows 10 is how to change the folders in the file system of the operating system. the following article will guide you to implement them.
  • The dd command in Linux, How to use the dd commandThe dd command in Linux, How to use the dd command
    dd is a command line utility for unix-like and unix operating systems, with the main purpose of converting and copying files.