User avatar
wj32
Topic Author
Posts: 948
OS: Windows
Location: Australia
Contact:

Command line reference

Sun Feb 06, 2011 9:20 am

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.
 
User avatar
OrdiFacil
Posts: 2
OS: Windows XP SP3 x86
Location: Paris, France
Contact:

Command line reference - Feedback

Thu Feb 17, 2011 8:50 am

:thumbup: Thanks! The "-hide" option is especially useful for peoples who want to start Process Hacker minimized at windows startup.
"We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare ; now, thanks to the Internet, we know that is not true." Robert Wilensky

"Give a man a fish and he will eat for a day. Teach a man to fish and he will eat for the rest of his life." Lao Tse
 
frank
Posts: 6
OS: windows 7

Re: Command line reference

Sat May 17, 2014 2:22 pm

Sounds like a noob could do it! I will be giving it a try sometime! Wish me luck!
 
isabel

Re: Command line reference

Wed Nov 05, 2014 12:34 am

:thumbup: :thumbup: :thumbup: very helpful
 
wschloss
Posts: 1
OS: Windows 7 64 bit

Re: Command line reference

Mon Nov 10, 2014 4:10 pm

It would save time if there was a command line option to start directly in "System Information/CPU/One Graph per CPU" or other "System Information/view" modes. Thank you for this very nice tool.
 
shackles
Posts: 16
OS: windows

Re: Command line reference

Sat Dec 10, 2016 9:10 pm

There are new command line actions? Like unloaddll and injectdll?
 
User avatar
dmex
Posts: 1162
Location: Australia

Re: Command line reference

Sun Dec 11, 2016 1:52 am

It would save time if there was a command line option to start directly in "System Information/CPU/One Graph per CPU" or other "System Information/view" modes. Thank you for this very nice tool.
There are plugins for this ;)
There are new command line actions? Like unloaddll and injectdll?
Those two options require user interaction and will not be available from the command line as they would likely become a target for malicious software.
 
shackles
Posts: 16
OS: windows

Re: Command line reference

Sun Dec 11, 2016 10:30 am

That's what I thought but when I was going through the source code I saw theses parameters so I asked.
 
orion44
Posts: 2
OS: Windows 7 64bit

Re: Command line reference

Sun Dec 18, 2016 10:59 pm

-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

Is there an option to Restart a process from the command line? This is an option in the GUI.

Who is online

Users browsing this forum: No registered users and 2 guests