/build/static/layout/Breadcrumb_cap_w.png

Passing a parameter to a Wisescript from a vbscript

Hello,

We are working on a package which uses both Wisescript and vbscript.
Basically, the Wisescript is the "main" script, and it calls a vbscript which performs a couple of tasks.
Is there a way of passing a string variable back to to the Wisescript?

We have thought, of course, of writing it in the registry, or in a file, or even as an environment variable, and then have the Wisescript read it from there. But, I was wondering if there is a different (more direct) way....

Thank you,

Mitsos

0 Comments   [ + ] Show comments

Answers (2)

Posted by: yarborg 17 years ago
Blue Belt
0
There is not a way to pass back a string variable but one of the methods I have used is to send back an integer through the wscript.quit command before exiting the vbscript. This probably won't work for this particular scenario but maybe something in the future.
Posted by: Robo Scripter 17 years ago
Orange Senior Belt
0
yarborg is correct in that you can not return a string.
However you can set up custom return codes within a vbscript to return a predetermined return code ("Wscript.Quit(9999)")
You then capture the returned value into %PROCEXITCODE% and continue the Wise Script with logic based on the returned value.

It is required that the "Wait for Program to Exit" check be selected.

Wise Script would look like the following

Execute .\TheVBscript.vbs (Wait)
Set Variable PROCEXITCODE to %PROCEXITCODE%
If PROCEXITCODE Equals "9999" then
Rem Do 9999 stuff
else
Rem Do something else
end

String values that are returned would need to be written to the registry or a text file.
I personally prefer to write a volatile key in the registry and destroy it at the end if the script, but to each his own.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ