Re: run external program, get return code
- From: "ekkehard.horner" <ekkehard.horner@xxxxxxxx>
- Date: Wed, 09 Jan 2008 17:33:28 +0100
Jay schrieb:
I am familar with WshShell.Exec and WhShell.Run. Basically I want to use the MS portqry tool, which according to its docs, has a quiet mode:
"-q 'quiet' operation runs with no output
returns 0 if port is listening
returns 1 if port is not listening
returns 2 if port is listening or filtered"
I'd like to get a simple VBS to run portqry and read the return value.
thoughts?
If you are familiar with .Run and .Exec, you probably know about
the bWaitOnReturn parameter to .Run
Optional. Boolean value indicating whether the script should wait for
the program to finish executing before continuing to the next
statement in your script. If set to true, script execution halts until
the program finishes, and Run returns any error code returned by the
program. If set to false (the default), the Run method returns
immediately after starting the program, automatically returning 0 (not
to be interpreted as an error code).
and the ExitCode property of the WShell object
Executables set an exit code when they finish running. This conveys
the status information when a process ends. Often, it is used to send
an error code (or some other piece of information) back to the caller.
If the process has not finished, the ExitCode property returns 0. The
values returned from ExitCode depend on the application that was
called.
.
- Follow-Ups:
- References:
- run external program, get return code
- From: Jay
- run external program, get return code
- Prev by Date: run external program, get return code
- Next by Date: Re: run external program, get return code
- Previous by thread: run external program, get return code
- Next by thread: Re: run external program, get return code
- Index(es):
Relevant Pages
|