Pass parameters to a vbs file 
Author Message
 Pass parameters to a vbs file

Dear good people,

How do I pass parameters to a vbs file, for example I have setup a script
that will check the state of my SQL server but I want to use this for all my
servers by passing the SQL server name and the script should take the
parameter and assign it to a variable, which I will use to check the server.

Thanks for your help,
-Max



Tue, 05 Feb 2002 03:00:00 GMT  
 Pass parameters to a vbs file
Via the command line...

myscript.vbs servername

In the script:

If wscript.arguments.count <> 1 then
    ... error - one and only one argument expected
end if

myservername = wscript.arguments(0) 'collection is 0-based

--
Michael Harris


| Dear good people,
|
| How do I pass parameters to a vbs file, for example I have setup a script
| that will check the state of my SQL server but I want to use this for all
my
| servers by passing the SQL server name and the script should take the
| parameter and assign it to a variable, which I will use to check the
server.
|
| Thanks for your help,
| -Max
|
|
|
|



Tue, 05 Feb 2002 03:00:00 GMT  
 Pass parameters to a vbs file
Thanks for your help.

-Max


Quote:
> Via the command line...

> myscript.vbs servername

> In the script:

> If wscript.arguments.count <> 1 then
>     ... error - one and only one argument expected
> end if

> myservername = wscript.arguments(0) 'collection is 0-based

> --
> Michael Harris



> | Dear good people,
> |
> | How do I pass parameters to a vbs file, for example I have setup a
script
> | that will check the state of my SQL server but I want to use this for
all
> my
> | servers by passing the SQL server name and the script should take the
> | parameter and assign it to a variable, which I will use to check the
> server.
> |
> | Thanks for your help,
> | -Max
> |
> |
> |
> |



Tue, 05 Feb 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Passing parameters to a .vbs-file?

2. How do you pass parameters from a batch file to a VBS file

3. How can i pass parameters to a VBScript (files *.vbs)

4. How do I pass a command-line parameter to my vbs file

5. How can i pass parameters to a VBScript (files *.vbs)

6. Passing parameters to .Vbs files

7. passing a parameter to a VBS file

8. How can i pass parameters to a VBScript (files *.vbs)

9. Passing parameters to vbs file

10. Passing parameter from VB to VBS

11. Passing parameters to VBS from Command Prompt

12. command line parameters passed to VBS???

 

 
Powered by phpBB® Forum Software