in your batch file, use this below command to execute vbscript
Execute vbs file from batch file
Ex:
Execute vbs file from batch file
Ex:
'cscript vbfilename
cscript
mytestvbscript.vbs
Passing parameters to a vb script
Ex2:
'dbservername is my 1st parameter
'dbname is my second parameter
cscript mytestvbscript.vbs testmachine1 testdb
in the vb script code, to fetch the passed values, use below code
strdbservername =
WScript.Arguments.Item(0)
strdbname = WScript.Arguments.Item(1)
strdbname = WScript.Arguments.Item(1)
'to print the fetched variables
wscript.echo strdbservername
wscript.echo strdbname
No comments:
Post a Comment