public class ProcessUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
debug |
| Constructor and Description |
|---|
ProcessUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getProcessId() |
static java.lang.String |
isProcessRunning(int procid)
Checks whether a process is running.
|
static int |
isProcessRunning(java.lang.String processName,
java.lang.String serviceName)
Check whether a process is running.
|
static void |
killProcess(int procid)
Kill a process for a given process ID.
|
static void |
killProcess(java.lang.String imageName)
Kill a process for a given image (executable) name.
|
static void |
startProcess(java.lang.String command,
java.lang.String dirname)
Start a process.
|
public static final boolean debug
public static int getProcessId()
public static void killProcess(java.lang.String imageName)
imageName - The image name (for example: notepad.exe)public static void killProcess(int procid)
procid - The ID for the process (PID) on the operating systempublic static java.lang.String isProcessRunning(int procid)
procid - The process IDpublic static int isProcessRunning(java.lang.String processName,
java.lang.String serviceName)
processName - The process name to look forserviceName - If the process is a service, the service name to check forpublic static void startProcess(java.lang.String command,
java.lang.String dirname)
command - The command line to executedirname - The directory to execute in