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
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)
Please log in to answer
Posted by:
yarborg
17 years ago
Posted by:
Robo Scripter
17 years ago
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
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.
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.
so that the conversation will remain readable.