<< Back Home UK uk   Donate Donate

Console Process KILL utility for Windows NT-family

Strange, but I could not find console utility for killing processes under Windows. Actually, there are many such utilities, but there is no one which can locate processes by

wkill supports Windows NT4, 2000, XP, 2003, Vista and higher (checked under Win10)

  • Window caption
  • sub-string of Window caption
  • module (executable) name
  • substring of full module (executable) pathname

So, I had to write WKILL myself. The name is chosen to avoid conflicts with sort of cygwin and unixport process kill utilities.

  wkill <options> [<params>]
  -c, --caption <Window Caption>  Caption of the window to be closed
  -C, --cap-substr <Window Caption>1;  Substring for matching Caption of the window
  -a, --all                       Kill all matching windows.
                                    By default only the 1st found window is closed
  -e, --exact                     Matching window captions exactly.
                                    By default all captions beginning from <Window Caption>
                                    are matched.
  -i                              Use case insensetive comparison (except caption substring).
  -p, --pid <Process ID>          Kill by process ID (PID).
  -n, --process-name <exac name>  Kill by process (executable) name.
  -N, --process-name-substr <exec name>
                                    Kill by matching part of full process name/path.
                                    By default (with -n) module name is matched exactly.
  -P, --match-path                Match by process (executable) path instead of name.
  -x, --exit-code <Exit code>     Process exit code (-1 by default).
  -w, --wait <N>                  Wait for <N> seconds untill matching process is detected,
                                     kill all matched and exit immediately.
  -W, --wait-kill-continue <N>    Wait for matching processes and kill'em during <N> seconds.
  -l, --list                      Enum (mached) processes without killing.
  -q, --quite                     Hide all messages
  When caption match is used, we send WM_CLOSE
  otherwise TerminateProcess system call is used
  wkill -c "Microsoft Word"
  wkill -p 440
  wkill -P -N "SysWOW64\dllhost.exe"
1 wkill -w 60 -c "setup.exe"
  wkill wkill -C "" -P -N "ssh.exe"

  • added options for caption substring matching.
  • implemented search for both caption and executable name/path
wkill_v6.rar/tgz (21.8 Kb/0 bytes)
wkill_v6_src.rar/tgz (9.4 Kb/0 bytes)

  • added -w and -W options for waiting for matching process(es).
  • added -q to suppress all messages including copyright notice.
wkill_v5.rar/tgz (21.2 Kb/22.1 Kb)
wkill_v5_src.rar/tgz (10.7 Kb/9.2 Kb)

  • added -P option for matching modules by substring of full module (executable) pathname
  • appeared, that -N option matched only executable name. Fixed
wkill_v4.rar/tgz (20.6 Kb/21.5 Kb)
wkill_v4_src.rar/tgz (9.8 Kb/141 bytes)

  • added -l option for enumerating running processes
  • added -N option for matching modules by substring of full module (executable) pathname
  • created project for VS2013. But it generates executable incompatible with old Windows versions.
wkill_v3.rar/tgz (20.3 Kb/21.2 Kb)
wkill_v3_src.rar/tgz (6.4 Kb/6.6 Kb)

wkill_v2.rar/tgz (19.6 Kb/20.4 Kb)
wkill_v2_src.rar/tgz (5.4 Kb/5.5 Kb)

Please, send your comments and propositions here: FB or mail (remove X)   Share

designed by Alter aka Alexander A. Telyatnikov powered by Apache+PHP under FBSD © 2002-2024