Changing file attributes with “attrib”

In addition to their actual content, files also have a set of properties that characterize them (sometimes called metadata.) One set of these properties are the four attributes read-only, hidden, system, and archive.

The archive attribute is primarily used in backup procedures but the other three can be encountered in various contexts. These attributes can be turned on or off with the command “attrib” and its switches.

The great utility of this command is that it can act on subfolders with its switch “/s” and can use the wildcard “*”.

For example, to clear the read-only , system, and hidden attributes from a file use

attrib -r -s -h somefile

This operation is not uncommon when system files have to be edited.

To restore the attributes the command is

attrib +r +s +h somefile

A common situation where it is desirable to clear the read-only attribute from many files is when files are copied from a CD. By default CD files are normally marked read-only. This can interfere with editing.

To clear the read-only attribute from all files in a folder and its subfolders use

attrib -r somefolder\*.* /s

If you want to process all files of a certain type such as MP3, use

attrib -r somefolder\*.mp3 /s



Fill in your details below or click an icon to log in:


អ្នក​កំពុង​បញ្ចេញ​មតិ​ដោយ​ប្រើ​គណនី របស់​អ្នក​។ Log Out /  ផ្លាស់ប្តូរ )

Google+ photo

អ្នក​កំពុង​បញ្ចេញ​មតិ​ដោយ​ប្រើ​គណនី Google+ របស់​អ្នក​។ Log Out /  ផ្លាស់ប្តូរ )

រូប Twitter

អ្នក​កំពុង​បញ្ចេញ​មតិ​ដោយ​ប្រើ​គណនី Twitter របស់​អ្នក​។ Log Out /  ផ្លាស់ប្តូរ )

រូបថត Facebook

អ្នក​កំពុង​បញ្ចេញ​មតិ​ដោយ​ប្រើ​គណនី Facebook របស់​អ្នក​។ Log Out /  ផ្លាស់ប្តូរ )


កំពុង​ភ្ជាប់​ទៅ​កាន់ %s