找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
查看: 4305|回复: 0

List file attribute value

[复制链接]

96

主题

158

回帖

4

精华

核心会员

积分
6513
发表于 2012-6-6 05:44:40 | 显示全部楼层 |阅读模式
说明

范例指令档示范如何使用 FileSystemObject 来列举一个档案的属性值。本范例指令档必需在本机执行。

范例指令码

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("C:\FSO\ScriptLog.txt")
If objFile.Attributes AND 0 Then
    Wscript.Echo "No attributes set."
End If   
If objFile.Attributes AND 1 Then
    Wscript.Echo "Read-only."
End If   
If objFile.Attributes AND 2 Then
    Wscript.Echo "Hidden file."
End If   
If objFile.Attributes AND 4 Then
    Wscript.Echo "System file."
End If   
If objFile.Attributes AND 32 Then
    Wscript.Echo "Archive bit set."
End If   
If objFile.Attributes AND 64 Then
    Wscript.Echo "Link or shortcut."
End If   
If objFile.Attributes AND 2048 Then
    Wscript.Echo "Compressed file."
End If

您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

快速回复 返回顶部 返回列表