passing values from .vbs file to command line under WSH 
Author Message
 passing values from .vbs file to command line under WSH

During the development of my .vbs file to process the files/directory,
it came out a question to me how to pass the result of a .vbs file to
other part of the batch file when I apply the .vbs file under command
line?  For example a .vbs file return 2 values, which are needed for
rest of the batch file command.

C Chang



Tue, 20 Sep 2005 12:18:11 GMT  
 passing values from .vbs file to command line under WSH

Quote:

> During the development of my .vbs file to process the files/directory,
> it came out a question to me how to pass the result of a .vbs file to
> other part of the batch file when I apply the .vbs file under command
> line?  For example a .vbs file return 2 values, which are needed for
> rest of the batch file command.

WSH hosted scripts can only return an exit code to the caller, not multiple
arbitrary values.

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US

Technet Script Center
http://www.microsoft.com/technet/scriptcenter/default.asp



Wed, 21 Sep 2005 09:06:15 GMT  
 passing values from .vbs file to command line under WSH
Quote:


> > During the development of my .vbs file to process the files/directory,
> > it came out a question to me how to pass the result of a .vbs file to
> > other part of the batch file when I apply the .vbs file under command
> > line?  For example a .vbs file return 2 values, which are needed for
> > rest of the batch file command.

> WSH hosted scripts can only return an exit code to the caller, not multiple
> arbitrary values.

> --
> Michael Harris
> Microsoft.MVP.Scripting
> Seattle WA US

> Technet Script Center
> http://www.microsoft.com/technet/scriptcenter/default.asp

Does that mean it only can return with either T/F or one string or
numeric type value?

C Chang



Wed, 21 Sep 2005 10:51:34 GMT  
 passing values from .vbs file to command line under WSH

Quote:
> Does that mean it only can return with either T/F or one string or
> numeric type value?

Scripts specify the exit code via:

    WScript.Quit n

where n can be any long integer value...

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US

Technet Script Center
http://www.microsoft.com/technet/scriptcenter/default.asp



Wed, 21 Sep 2005 11:58:41 GMT  
 passing values from .vbs file to command line under WSH
Quote:

> > Does that mean it only can return with either T/F or one string or
> > numeric type value?

> Scripts specify the exit code via:

>     WScript.Quit n

> where n can be any long integer value...

> --
> Michael Harris
> Microsoft.MVP.Scripting
> Seattle WA US

> Technet Script Center
> http://www.microsoft.com/technet/scriptcenter/default.asp

Michael:
   Thanks.  I have found that use from another web paper and used it in
the errorlevel check.  However, I am really looking more extended use of
the .vbs.  Of course I can use the .vbs to write out a .txr file. but
that limit my use the result directly.  IF this is the only way, I just
have to live with it.

C Chang



Thu, 22 Sep 2005 12:46:51 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Passing values into and out of Command Line application *and* command line prompt in vbscript

2. Passing values from vbscript wsh to command line/DOS

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

4. pass command line argument value to a function?

5. command line parameters passed to VBS???

6. Passing multiple arguments to command line via run method in WSH

7. Command line args in a .vbs file

8. Passing values to a .VBS file...

9. Pass a value to a vbs file

10. Passing values to variables in a .vbs file

11. Scripting command line applications & Command Line Prompting

12. How to pass back variables from called vbs from vbs using wsh

 

 
Powered by phpBB® Forum Software