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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
J
Java Code Geeks
I
InfoQ
V
Visual Studio Blog
M
MIT News - Artificial intelligence
H
Help Net Security
博客园_首页
Blog — PlanetScale
Blog — PlanetScale
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
人人都是产品经理
人人都是产品经理
G
Google Developers Blog
A
About on SuperTechFans
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
S
SegmentFault 最新的问题
WordPress大学
WordPress大学

博客园 - 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:\