
How do you pass parameters from a batch file to a VBS file
Quote:
> I'm very new to VBScript (I have only tried to use it
> within the last 4 hours).
Yeah, but translating from Internet time to people time that's 4 _years_.
;)
Quote:
> I need to be able to pass in parameters from a command
> line and then have a VBS file use these parameters when
> processing.
Get the WSH documentation - go to http://www.microsoft.com/downloads and
pick "Windows Script" from the dropdown; the Windows Script Docs are
available under there. You'll find it useful for looking up some details
of this as you go.
I'm not sure what you are wanting to do precisely, but here's a simple
"intro" to using arguments with WSH scripts.
You supply arguments to the WSH script just like you would any
application. WSH-hosted scripts automatically have a WScript.Arguments
collection exposed which contains all of the arguments supplied to the
script. So for example let's take a script named test.vbs that looks like
this:
'test.vbs
for each arg in WScript.Arguments
wscript.echo arg
next
The arguments collection correctly parses quoted arguments; if you run the
script with the following command line:
cscript test.vbs a "second argument" thirdArg "4th Arg"
you will get the following output:
Arg1
second argument
thirdArg
4th Arg
Quote:
> I'd appreciate a sample batch and VBS file if possible.
> TIA
> Scott Huerta
> Distinctive Solutions Corporation
--
Please respond in the newsgroup so everyone may benefit.
http://dev.remotenetworktechnology.com
(email requests for support contract information welcomed)
----------
Microsoft's new UNIFIED Terminal Services Newsgroup: