Passing variable from CMD to VBS

I'm launching a .vbs script by calling it from the command prompt. I'd like for the command prompt to pass a variable to the .vbs file. Is this possible? If so, how?
Who is Participating?
In the VBScript part you would add something like this.
From the batch file you would write out the entry like this...
wscript my-vb-file.vbs "Test"
The "Test" is the parameter being passed.
Dim objArgs
Set objArgs = Wscript.Arguments
wscript.echo objArgs(0)

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.