Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return value of pwexit 1

Status
Not open for further replies.

jthayer

Programmer
Oct 18, 2004
6
US
Hi,
I am very new to this. I am experimenting with using a VB.NET class called Process to run pw5.exe with arguments. Once the script specified in my Process call has run, pw5 exits and I capture its exit code. Unfortunately, this appears to be 0 whether my script failed or succeeded. I see that one can use a command to exit a child script and return a user defined return value. Going up a level, is there a way I can manipulate the return value of pw5.exe based on the success or failure of my script? I doubt it, and the OS might not like it anyway. Can someone suggest an alternative way of getting a pertinent return value back to my calling Process class?
Thanks in advance.

JT
 
To the best of my knowledge, there is not a way to specify the exit code when Procomm is closed. One way I can think of to do this is to have your script set an environment variable using the putenv command and then your program could query that environment variable for the exit value (at least, I think this should work).


aspect@aspectscripting.com
 
Thanks knob. I tried this last PM. I established a System Environment variable on Win2003 Server, tried to use putevn in an Aspect script to change it, and retrieved the value from my calling VB.NET app once Procomm had exited. Unfortunately, the value did not seem to have been changed by Procomm. This raises three questions for me:
1. Should I use a user environment var, rather than a system one?
2. Do I need to assign Procomm some special permissions on Windows 2003 Server to enable it to change environment variables?
3. Am I right to wait until Procomm exits to be checking this variable, or should I poll for it while the script is running?
Thanks again.
JT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top