2019-03-10 12:32:03 +00:00
|
|
|
# attrib
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
> 显示或修改文件和目录的属性。
|
2022-10-04 16:06:23 +01:00
|
|
|
> 更多信息:<https://learn.microsoft.com/windows-server/administration/windows-commands/attrib>.
|
2019-03-10 12:32:03 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 显示当前目录下所有文件的属性:
|
2019-03-10 12:32:03 +00:00
|
|
|
|
|
|
|
`attrib`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 显示当前目录和其子目录下所有文件的属性:
|
2019-03-10 12:32:03 +00:00
|
|
|
|
|
|
|
`attrib /S`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 显示当前目录和其子目录下所有文件和目录的属性:
|
2019-03-10 12:32:03 +00:00
|
|
|
|
|
|
|
`attrib /S /D`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 为一个文件增加只读属性:
|
2019-03-10 12:32:03 +00:00
|
|
|
|
|
|
|
`attrib +R {{document.txt}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 删除一个文件的系统和隐藏属性:
|
2019-03-10 12:32:03 +00:00
|
|
|
|
|
|
|
`attrib -S -H {{document.txt}}`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 为一个目录增加隐藏属性:
|
2019-03-10 12:32:03 +00:00
|
|
|
|
|
|
|
`attrib +H {{目录的路径}}`
|