Deadline Scripting Reference  10.4.1.8
Deadline.Scripting.ProcessUtils Class Reference

Process utility functions. More...

Static Public Member Functions

static bool IsProcessRunning (string name)
 Checks if a process is running. More...
 
static void KillParentAndChildProcesses (int parentId)
 Kill the parent process and all of its child processes. More...
 
static bool KillProcesses (string name)
 Kills all processes with the given name. More...
 
static bool KillProcesses (string name, int attempts)
 Attempts to kill all processes with the given name a specified number of times. More...
 
static Process ShellExecute (string filename)
 Shell executes the specified file. More...
 
static Process ShellExecute (string filename, string verb)
 Shell executes the specified file using the specified verb. More...
 
static Process SpawnProcess (string executable)
 Spawns a process. More...
 
static Process SpawnProcess (string executable, string arguments)
 Spawns a process. More...
 
static Process SpawnProcess (string executable, string arguments, string workingDirectory)
 Spawns a process. More...
 
static Process SpawnProcess (string executable, string arguments, string workingDirectory, ProcessWindowStyle windowStyle)
 Spawns a process. More...
 
static Process SpawnProcess (string executable, string arguments, string workingDirectory, ProcessWindowStyle windowStyle, bool redirectStdOutput)
 Spawns a process. More...
 
static bool WaitForExit (Process process, int timeoutMilliseconds)
 Waits for a process to exit. More...
 
static bool WaitForProcessToStart (string name, int timeoutMilliseconds)
 Waits for a process with the given name to start. More...
 

Detailed Description

Process utility functions.

Member Function Documentation

◆ IsProcessRunning()

static bool Deadline.Scripting.ProcessUtils.IsProcessRunning ( string  name)
static

Checks if a process is running.

Parameters
nameThe process name.
Returns
True if the process is running.

◆ KillParentAndChildProcesses()

static void Deadline.Scripting.ProcessUtils.KillParentAndChildProcesses ( int  parentId)
static

Kill the parent process and all of its child processes.

Parameters
parentIdThe parent process' ID.

◆ KillProcesses() [1/2]

static bool Deadline.Scripting.ProcessUtils.KillProcesses ( string  name)
static

Kills all processes with the given name.

Parameters
nameThe process name.
Returns
True if any processes were found and killed.

◆ KillProcesses() [2/2]

static bool Deadline.Scripting.ProcessUtils.KillProcesses ( string  name,
int  attempts 
)
static

Attempts to kill all processes with the given name a specified number of times.

Parameters
nameThe process name.
attemptsThe number of attempts before we give up.
Returns

◆ ShellExecute() [1/2]

static Process Deadline.Scripting.ProcessUtils.ShellExecute ( string  filename)
static

Shell executes the specified file.

Parameters
filenameThe file name.
Returns
The process object.

◆ ShellExecute() [2/2]

static Process Deadline.Scripting.ProcessUtils.ShellExecute ( string  filename,
string  verb 
)
static

Shell executes the specified file using the specified verb.

Parameters
filenameThe file name.
verbThe verb (ie: explore). Specify null to omit the verb.
Returns
The process object.

◆ SpawnProcess() [1/5]

static Process Deadline.Scripting.ProcessUtils.SpawnProcess ( string  executable)
static

Spawns a process.

Parameters
executableThe executable file name.
Returns
The process object.

◆ SpawnProcess() [2/5]

static Process Deadline.Scripting.ProcessUtils.SpawnProcess ( string  executable,
string  arguments 
)
static

Spawns a process.

Parameters
executableThe executable file name.
argumentsThe arguments.
Returns
The process object.

◆ SpawnProcess() [3/5]

static Process Deadline.Scripting.ProcessUtils.SpawnProcess ( string  executable,
string  arguments,
string  workingDirectory 
)
static

Spawns a process.

Parameters
executableThe executable file name.
argumentsThe arguments.
workingDirectoryThe working directory.
Returns
The process object.

◆ SpawnProcess() [4/5]

static Process Deadline.Scripting.ProcessUtils.SpawnProcess ( string  executable,
string  arguments,
string  workingDirectory,
ProcessWindowStyle  windowStyle 
)
static

Spawns a process.

Parameters
executableThe executable file name.
argumentsThe arguments.
workingDirectoryThe working directory.
windowStyleThe window style.
Returns
The process object.

◆ SpawnProcess() [5/5]

static Process Deadline.Scripting.ProcessUtils.SpawnProcess ( string  executable,
string  arguments,
string  workingDirectory,
ProcessWindowStyle  windowStyle,
bool  redirectStdOutput 
)
static

Spawns a process.

Parameters
executableThe executable file name.
argumentsThe arguments.
workingDirectoryThe working directory.
windowStyleThe window style.
redirectStdOutputIf standard output should be redirected.
Returns
The process object.

◆ WaitForExit()

static bool Deadline.Scripting.ProcessUtils.WaitForExit ( Process  process,
int  timeoutMilliseconds 
)
static

Waits for a process to exit.

Parameters
processThe process object.
timeoutMillisecondsThe timeout in milliseconds. Specify -1 to wait until the process exits.
Returns
True if the process exits before the timeout.

◆ WaitForProcessToStart()

static bool Deadline.Scripting.ProcessUtils.WaitForProcessToStart ( string  name,
int  timeoutMilliseconds 
)
static

Waits for a process with the given name to start.

Parameters
nameThe process name.
timeoutMillisecondsThe timeout in milliseconds. Specify -1 for no timeout.
Returns
True if the process started before the timeout.