pass values to script? 
Author Message
 pass values to script?


example, I wish to have 2 variables available to my script that are unknown
until we pass them via a command:

c:\scripts\myScript.vbs "value 1", "value 2"

Then, in the script I would have 2 values to use: "value 1" & "value 2"

Thank you.



Mon, 28 Feb 2005 22:48:18 GMT  
 pass values to script?
Download the docs:
http://download.microsoft.com/download/winscript56/Install/5.6/W982KM...
US/scrdoc56en.exe
Then look up the "arguments" object.  You'll find what you need there along
with some example code.
Have fun!


Quote:

> example, I wish to have 2 variables available to my script that are
unknown
> until we pass them via a command:

> c:\scripts\myScript.vbs "value 1", "value 2"

> Then, in the script I would have 2 values to use: "value 1" & "value 2"

> Thank you.



Mon, 28 Feb 2005 22:56:36 GMT  
 pass values to script?
Here's a nice example fromthe doc:
Set objArgs = WScript.Arguments
For I = 0 to objArgs.Count - 1
   WScript.Echo objArgs(I)

Quote:

> example, I wish to have 2 variables available to my script that are
unknown
> until we pass them via a command:

> c:\scripts\myScript.vbs "value 1", "value 2"

> Then, in the script I would have 2 values to use: "value 1" & "value 2"

> Thank you.



Mon, 28 Feb 2005 22:57:54 GMT  
 pass values to script?
Whups! :-)

Here's a nice example fromthe doc:

Set objArgs = WScript.Arguments
For I = 0 to objArgs.Count - 1
   WScript.Echo objArgs(I)
Next


Quote:
> Here's a nice example fromthe doc:
> Set objArgs = WScript.Arguments
> For I = 0 to objArgs.Count - 1
>    WScript.Echo objArgs(I)



For
> > example, I wish to have 2 variables available to my script that are
> unknown
> > until we pass them via a command:

> > c:\scripts\myScript.vbs "value 1", "value 2"

> > Then, in the script I would have 2 values to use: "value 1" & "value 2"

> > Thank you.



Mon, 28 Feb 2005 23:01:42 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Passing value from Server script to client script.

2. How can pass a value from Vb script to java script

3. Passing value form FileMaker script to a Visual Basic executable

4. Passing values from client vars to Server script

5. Passing values by reference from java / vb script to ActiveX object

6. Passing a value from ASP to the script

7. passing date value as arg to script

8. passing value of text box to a server side script

9. Passing values by reference from java / vb script to ActiveX object

10. Passing Value from One script to another?

11. Passing Value to VB Script

12. Passing values between an ASP page and an HTA - VBS script

 

 
Powered by phpBB® Forum Software