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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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.
Answered 04/16/2007 by: yarborg
Blue Belt

Please log in to comment
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.
Answered 04/16/2007 by: Robo Scripter
Orange Senior Belt

Please log in to comment
Answer this question or Comment on this question for clarity