errorlevel

  • Thread starter Thread starter Luke Vogel
  • Start date Start date
L

Luke Vogel

Hi all ...

I'm writing a small application that needs to run a number of console
executables.

No problem, I can use the 'shell' function with all its useful
parameters to run each console app.

My problem is that I need to react to the ERRORLEVEL that is returned by
the console executables in each case.

The shell function returns a processID which is not useful in this case.

Can anyone guide me as to how to query the ERRORLEVEL system variable?

Kind regards ...
 
Luke Vogel said:
I'm writing a small application that needs to run a number of console
executables.

No problem, I can use the 'shell' function with all its useful
parameters to run each console app.

My problem is that I need to react to the ERRORLEVEL that is returned by
the console executables in each case.

The shell function returns a processID which is not useful in this case.

If you are using 'Process.Start' to start the executable you can use the
'Process' object's 'ExitCode' property to determine the exit code.
 
Hi Herfried,

I've tried what you suggested ...

The application test shell I've written runs a couple of simple batch
files to return errorlevels.

These are started as processes, but by the time I query the ExitCode
property of the process, it throws an exception because the process has
already terminated(I assume).

The errormessage suggests that "there is no process associated with this
object".

Any ideas?

Luke
 
Don't worry ... all figured out.

Thank you all for your help this year.

I've asked a number of questions from time to time, and have always
received prompt and effective assistance.

Many thanks to all.

Luke.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top