惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
Y
Y Combinator Blog
I
InfoQ
美团技术团队
罗磊的独立博客
B
Blog RSS Feed
GbyAI
GbyAI
小众软件
小众软件
IT之家
IT之家
Engineering at Meta
Engineering at Meta
Blog — PlanetScale
Blog — PlanetScale
V
V2EX
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
MyScale Blog
MyScale Blog
博客园 - 聂微东
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss

博客园 - xjy

elasticsearch 6.1.1 transport jar docker-compose 获取时区 maven插件 jquery_ui_api中文 sax xpath读取xml字符串 Ant打包 [转]html5音乐播放器 javax mail网址 INNO SETUP 读取可变注册表路径的问题 fso查找被删除的文件 NTP校时设置 发送邮件测试 Tomcat启动,不能加载项目问题。 生成javadoc 【转】关闭特定虚拟机上声音嘟嘟声 vs2010取消显示所有文件 崩溃 FastJson wps使用技巧
vbscript调用fso
xjy · 2014-12-08 · via 博客园 - xjy

function getVersion(strPath)
Dim fver, fso
Set fso = CreateObject("Scripting.FileSystemObject")
fver = fso.GetFileVersion(strPath)
getVersion=fver
end function

sub saveResult(strOutPath,str)
Dim fver, fso
On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemObject")
Set fileObj = fso.opentextfile(strOutPath+"\\version.xml",2,true) '使用FSO创建文件写入对象
fileObj.Write str '向文件写入数据,覆盖形式写入
fileObj.close '推送内容写入并关闭写入通道
end sub

'Create an arguments object
Dim oArgs
Set oArgs = WScript.Arguments

'Get the named arguments
Dim oNamed
Set oNamed = oArgs.Named

'Get the computer name argument
Dim strPath
strPath = oNamed("strPath")

Dim strOutPath
strOutPath = oNamed("outPath")

dim tmp
tmp=getVersion(strPath+"\\install.exe")
tmp=tmp+"test"
msgbox tmp

saveResult strOutPath, tmp
msgbox strOutPath

dos命令行中:

   CScript "getFileVer.vbs" /strPath:C:\ /outPath:c:\