VBScript calls FSO

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.