The Attrib command is used to operate the attributes of a file or directory, including setting or clearing read-only, archive, system, hidden, indexed, offline, and temporary attributes. Usage is as follows: display file attributes: attrib file name set file attributes: attrib [ |-] option [file name] clear file attributes: attrib - option [file name]
Attrib command usage
The Attrib command is used to display or change the attributes of a file or directory.
Syntax:
<code>attrib [+R|-R] [+A|-A] [+S|-S] [+H|-H] [+I|-I] [+O|-O] [+X|-X] [文件名]</code>
Options:
Options | Description |
---|---|
R | Set read-only attribute |
-R | Clear read-only attributes |
A | Set archive attributes |
Clear archive attributes | |
Set system properties | |
Clear system properties | |
Set hidden attributes | |
Clear hidden attributes | |
Set index properties | |
Clear index properties | |
Set offline attributes | |
Clear offline attributes | |
Set temporary Properties | |
Clear temporary properties |
<code>attrib 文件名</code>
<code>attrib test.txt</code>
<code>attrib [+|-] 选项 [文件名]</code>
<code>attrib +R test.txt</code>
This will set the read-only attribute of the test.txt file.
<code>attrib - 选项 [文件名]</code>
<code>attrib -R test.txt</code>
This will clear the read-only attribute of the test.txt file.
Note:You must run Command Prompt as an administrator to change file attributes.
The above is the detailed content of How to use attrib command. For more information, please follow other related articles on the PHP Chinese website!