Jump to content

Check the exit status of a called executable


Recommended Posts

Hi all!

Ok, I think this should be a simple solution, but I don't know how to script it. I am invoking an external setup.exe with some switches, identifying the Process ID, pausing the script until the setup finishes and then I need to check the exit status of the external setup.exe process. I've got everything working, but I'm not sure how to determine the exit status of the setup file. Furthermore, I'm not sure what the possible exit codes are for the setup file. I thought that when a setup finished it exits with status = 0 but I'm not 100% sure. Here is what I have...

$path = "c:\setup.exe"

$PID = Run ($path & " /silent")

ProcessWaitClose ($PID)

Now I'm not sure what to use. Any ideas?

Thanks!!

Link to comment
Share on other sites

Look for _RunReadStd() by lod3n

I have a couple of adds I did for my needs, but his is an excellent implementation that will get you everything you need and more.

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...