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) ' Write to object using FSO creation file
Fileobj.write Str ' writes data to a file, overwriting form writes
Fileobj.close ' push content writes and closes the write channel
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 command line:
CScript "Getfilever.vbs"/strpath:c:\/outpath:c:\
VBScript calls FSO