Run VBS file with command line and pass parameter

VBS Code:

1
2
3
4
5
Set args = WScript.Arguments
If args.Count = 1 Then
test= WScript.Arguments(0)
MsgBox "test " & name
End If

Save this code in test.vbs file.

Command Code:

1
wscript.exe test.vbs helloworld

The result will be “test Helloworld”.

唐胡璐 wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!
分享创造价值,您的支持将鼓励我继续前行!