作者:Wingl83 | 时间:2008-11-01 21:42 | 标题:[求助]用批处理更改文件属性
一.我用GB浏览器,恐防搜索引擎文件(D:\GreenBrowser 简体中文绿色增强版\User\SearchEngine.ini)被自动修改,所以我会将SearchEngine.ini打上“只读”属性,当自己需要手动修改SearchEngine.ini文件时,又取消SearchEngine.ini的“只读”属性。
我需要一个批处理,当我运行它的时候,它会自动检测D:\GreenBrowser 简体中文绿色增强版\User\SearchEngine.ini文件的属性,当SearchEngine.ini的属性为“只读”时取消“只读”属性;当SearchEngine.ini的属性不为只读时,赋予SearchEngine.ini只读属性。
二.我有一个文件(见附件),它的属性为隐藏,特别的是,“隐藏”属性的选项框为不可选状态。是怎样设置成这样呢?又怎样还原呢?
作者:HAT | 时间:2008-11-01 22:12
attrib /?
作者:tireless | 时间:2008-11-01 22:22
一、我觉得你可以为这个文件做个备份
二、加上“系统”属性,“隐藏”选项框就会不可选。
作者:Wingl83 | 时间:2008-11-01 22:31
attrib -r D:\GreenBrowser 简体中文绿色增强版\User\SearchEngine.ini
没有用,出了什么问题?
另:系统属性在哪里设置?
作者:HAT | 时间:2008-11-01 22:46 | 标题:Re 4楼
遇到空格就加引号,尽快记住这句话^_^
C:\Test>attrib /?
Displays or changes file attributes.
ATTRIB
]
+ Sets an attribute.
- Clears an attribute.
R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
Specifies a file or files for attrib to process.
/S Processes matching files in the current folder
and all subfolders.
/D Processes folders as well.
作者:Wingl83 | 时间:2008-11-01 23:09
加了引号也没有用……
作者:HAT | 时间:2008-11-02 10:33 | 标题:Re 6楼
C:\Test>attrib /?
Displays or changes file attributes.
ATTRIB
]
+ Sets an attribute.
- Clears an attribute.
R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
Specifies a file or files for attrib to process.
/S Processes matching files in the current folder
and all subfolders.
/D Processes folders as well.
作者:wxcute | 时间:2008-11-02 10:46
系统属性和隐藏属性要同时设置才有变化
attrib +s +h +r "文件(目录)名"
attrib -s -h -r "文件(目录)名"