Process object, which run the given command immediately.
Command arguments can be passed in two ways: 1. using
args, 2. appending to
cmd and leaving
argsto pass command arguments, each argument will be automatically quoted, and shell meta-characters will be escaped if needed.
cmdshould be an executable name that can be located in the
PATHenvironment variable, or a path to an executable.
argsis not given or is
null, command arguments can be appended to
cmd. No automatic quoting/escaping will be performed.
cmdshould be formatted exactly as it would be when typed at the command line. It can run executables, as well as shell commands that are not executables (e.g. on Windows:
close() should be called when the
Process is no longer used.
Close the process handle and release the associated resources.
Process fields should not be used after
close() is called.
Block until the process exits and return the exit code of the process. If the process has already exited, return the exit code immediately.