How to pass back variables from called vbs from vbs using wsh 
Author Message
 How to pass back variables from called vbs from vbs using wsh

I'm using WSH and VBS

I have many scripts that will require me to browse folders and select
a file.  I would like to create a second script that does this, that I
can call from all my scripts that will return a varibale or multiple
variables to the calling vbs script.  In this case, return the
variable that holds the path and file name from the browse script to
the calling script.

Thanks



Sat, 14 Aug 2004 09:06:55 GMT  
 How to pass back variables from called vbs from vbs using wsh
Write your library of common routines as public methods of a WSC (Windows Script Component) and you can pass anything you want back and forth...

Script Components
http://msdn.microsoft.com/library/en-us/script56/html/lettitle.asp

--
Michael Harris
Microsoft.MVP.Scripting
--

Quote:

> I'm using WSH and VBS

> I have many scripts that will require me to browse folders and select
> a file.  I would like to create a second script that does this, that I
> can call from all my scripts that will return a varibale or multiple
> variables to the calling vbs script.  In this case, return the
> variable that holds the path and file name from the browse script to
> the calling script.

> Thanks



Sat, 14 Aug 2004 09:45:43 GMT  
 How to pass back variables from called vbs from vbs using wsh
You can do this via an Execute or ExecuteGlobal command and load the
sub-script so you have access to all of its functions, or actually
use the Exec function to run the code and have the second script pass
the info back to StdOut.  That's in VBScript; in Jscript you can use
Eval() I think.

both of the above have some details to implementation (which can be
found in the docs below) but it sounds like you are trying to make
sure you re-use code instead of rewriting it (what a concept, huh?).

The WSH development people actually implemented several ways to do
this, including an "include" statement for a script in WSF files.
Details depend on what you want to pass back how, so this is a
"code-free" post unfortunately.
--
http://download.microsoft.com/download/winscript56/Install/5.6/W982KMe
XP/EN-US/scrdoc56en.exe


Quote:
> I'm using WSH and VBS

> I have many scripts that will require me to browse folders and
select
> a file.  I would like to create a second script that does this, that
I
> can call from all my scripts that will return a varibale or multiple
> variables to the calling vbs script.  In this case, return the
> variable that holds the path and file name from the browse script to
> the calling script.

> Thanks



Sat, 14 Aug 2004 09:56:14 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. passing variable to vbs program (WSH)

2. Calling a vbs from another vbs

3. Calling a VBS sub with passing in vars.

4. Add computer in domain with vbs or tools call by vbs

5. Calling *.vbs files to Run From Master VBS File

6. how to call vbs file from vbs file

7. Calling a .vbs file from another vbs

8. Newbie question - calling a VBS script from another VBS script

9. passing variables from .bat files to .vbs scripts

10. How do I pass a variable to *.vbs

11. passing variables from VBS to JS

12. Passing values to variables in a .vbs file

 

 
Powered by phpBB® Forum Software