Re: Passing an argument by Pegasus
Pegasus
Fri Mar 07 14:52:34 CST 2008
"Jeff Belorit" <jbelorit@mbi-inc.com> wrote in message
news:edMy9NJgIHA.4140@TK2MSFTNGP04.phx.gbl...
> Hello,
>
> I was wondering how I could call a vbscript and pass an argument when I
> call it.
>
> I want to pass a filename to be used
>
> thanks
You can pass an argument by running the script like so:
MyScript.vbs Argument1 Argument2 "Argument 3"
But perhaps you really want to know how to ***pick up***
a passed argument:
Set objArgs = WScript.Arguments
wscript.echo "Number of parameters=" & objArgs.Count
wscript.echo "Param 1 = " & objArgs(0)
wscript.echo "Param 2 = " & objArgs(1)
etc.