中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-12 23:34
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 如何用VBS读取文件*.DLL *.EXE的文件版本信息,系统属性等 查看 908 回复 2
楼 主 如何用VBS读取文件*.DLL *.EXE的文件版本信息,系统属性等 发表于 2010-01-04 18:46 ·  美国 Nokia
中级用户
★★
过度热情
积分 321
发帖 139
注册 2006-03-21 17:19
20年会员
UID 52521
性别 男
状态 离线
如题:如何用VBS读取文件*.DLL *.EXE的文件版本信息,系统属性等
知识在于不断积累
2 发表于 2010-01-04 20:06 ·  中国 北京 中电华通通信有限公司
高级用户
★★★
据说是李先生
积分 609
发帖 400
注册 2008-04-23 15:55
18年会员
UID 116706
性别 男
状态 离线
Function GetVersion(pathspec)
Dim fso, temp
Set fso = CreateObject("Scripting.FileSystemObject")
temp = fso.GetFileVersion(pathspec)
If Len(temp) Then
GetVersion = temp
Else
GetVersion = "无可用版本信息!"
End If
End Function


Function GetAttributes(pathspec)
Dim fso, f, temp, str
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(pathspec)
temp = f.Attributes
str = ""
If temp and 4 Then str = str & "系统"
If temp and 2 Then str = str & "隐藏"
If temp and 1 Then str = str & "只读"
If str = "" Then str = "普通"
GetAttributes = str
End Function


filepath = "C:\Windows\system32\shell32.dll"
msgbox filepath & " 的版本是 " & GetVersion(filepath)
msgbox filepath & " 的属性是 " & GetAttributes(filepath)


[ Last edited by qinchun36 on 2010-1-5 at 10:00 ]
本帖最近评分记录 (共 1 条) 点击查看详情
评分人分数时间
piziliu2004 +4 2010-01-04 21:40
┏━━━━━━┓
┃据说是李先生┃
┠──────┨
┃*ntRSS┃
┗━━━━━━┛
3 发表于 2010-01-04 21:46 ·  中国 上海 闵行区 电信
中级用户
★★
过度热情
积分 321
发帖 139
注册 2006-03-21 17:19
20年会员
UID 52521
性别 男
状态 离线
Thanks. 2楼。 呵呵之前一直没找到GetFileVersion函数,呵呵
知识在于不断积累
论坛跳转: