Home > System Tutorial > Windows Series > How to use attrib command

How to use attrib command

小老鼠
Release: 2024-04-18 17:45:26
Original
768 people have browsed it

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]

How to use attrib command

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>
Copy after login

Options:

##-AClear archive attributes SSet system properties-SClear system properties HSet hidden attributes-HClear hidden attributes ISet index properties-IClear index properties OSet offline attributes-OClear offline attributes XSet temporary Properties-XClear temporary properties
Options Description
R Set read-only attribute
-R Clear read-only attributes
A Set archive attributes
##Usage:

    Display file properties:
  1. <code>attrib 文件名</code>
    Copy after login
  2. For example:
<code>attrib test.txt</code>
Copy after login

    Set file properties:
  1. <code>attrib [+|-] 选项 [文件名]</code>
    Copy after login
  2. For example:
<code>attrib +R test.txt</code>
Copy after login

This will set the read-only attribute of the test.txt file.

    Clear file attributes:
  1. <code>attrib - 选项 [文件名]</code>
    Copy after login
  2. For example:
<code>attrib -R test.txt</code>
Copy after login

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.
  • Some properties are not available for certain file types.
  • Be careful when using the attrib command as incorrect settings may result in inaccessible files or loss of data.

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template