Command line reference - Process Hacker Forums

Process Hacker CLI

Command line reference

User avatar
wj32

Command line reference

Process Hacker supports a limited number of command line options, listed below.

-settings filename

This option allows you to specify the location of Process Hacker's settings file. filename can be a relative path, in which case the current working directory at startup is used as the base.

Examples:
ProcessHacker.exe -settings settings.xml

-nosettings

Disables settings. Settings are set to their defaults at startup, and no settings are saved.

-noplugins

Disables plugins, even if the "Enable plugins" option is set.

-newinstance

Starts a new instance of Process Hacker, even if the "Allow only one instance" option is set.

-v

Forces Process Hacker's main window to be displayed at startup, even if the "Start hidden" option is enabled.

-hide

Hides Process Hacker's main window at startup, even if the "Start hidden" option is disabled.

-elevate

Prompts for elevation if Process Hacker is not started with elevated privileges.

-c -ctype objecttype -cobject object -caction action -cvalue value

Enables command mode. The status of the operation is returned in the exit status of the process.

Possible values of objecttype:

  • "process". object is the process ID, and action can be "terminate", "suspend", "resume", "priority", "iopriority" or "pagepriority".
  • "service". object is the service name, and action can be "start", "continue", "pause", "stop" or "delete".
  • "thread". object is the thread ID, and action can be "terminate", "suspend" or "resume".

Examples:

ProcessHacker.exe -c -ctype process -cobject 1424 -caction terminate
ProcessHacker.exe -c -ctype process -cobject 5896 -caction priority -cvalue high
ProcessHacker.exe -c -ctype service -cobject Winmgmt -caction pause

-s

Enables silent mode. No error messages are displayed for command mode, -installkph and -uninstallkph.

-ras

Enters run-as-service mode. This is used internally by the Run As command.

-nokph

Disables KProcessHacker. Process Hacker will not attempt to load the driver or connect to it.

-installkph

Installs KProcessHacker as a System Start service.

-uninstallkph

Deletes the KProcessHacker service.

-debug

Shows the debug console early in the startup process.

-showoptions -hwnd parentwindow -point x,y

Displays the Advanced tab of the options window only. parentwindow specifies the parent window handle in hexadecimal and x,y specifies the location of the options window.

-phsvc

Enters phsvc mode. This exposes a LPC-based API currently used by Process Hacker for tasks that require elevation.

-priority r|h|n|l

Sets the priority of Process Hacker to realtime (r), high (h), normal (n) or idle (l).

-selectpid pid

Selects pid in a new or existing instance of Process Hacker.

-sysinfo section

Opens the System Information window at startup, and optionally navigates to the specified section.