求vb改文件属性语句

来源:百度知道 编辑:UC知道 时间:2024/05/30 16:00:26
怎么用vb改文件的属性?

最简单的shell调用attrib.exe改属性,attrib.exe 方法:
如Shell "attrib.exe c:\autoexec.bat -R +H -A"
+ 设置属性。
- 清除属性。
R 只读文件属性。
A 存档文件属性。
S 系统文件属性。
H 隐藏文件属性。
[drive:][path][filename]
指定要处理的文件属性。
/S 处理当前文件夹及其子文件夹中的匹配文件。
/D 也处理文件夹。

LS。。那不是最简单的吧- -
有函数的!!
Sub SetAttr(PathName As String, Attributes As VbFileAttribute)
VBA.FileSystem 的成员
设置一个文件的属性信息