|
| 1 | +# killall — Windows Process Termination Tool |
| 2 | + |
| 3 | +A fast, feature-rich `killall` command for Windows 11, written in C++. |
| 4 | +Kill processes by name, pattern, port, DLL, window title, CPU/RAM usage, and more. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## Features |
| 9 | + |
| 10 | +| Capability | Description | |
| 11 | +|---|---| |
| 12 | +| Pattern matching | Exact, substring, glob (`*`/`?`), regex (`/pattern/`) | |
| 13 | +| Process tree | Kill a process and all its children with `--tree` | |
| 14 | +| Port targeting | Kill whatever is holding a port or port range | |
| 15 | +| DLL/module matching | Kill processes that have a specific DLL loaded | |
| 16 | +| Window title | Kill by visible window title | |
| 17 | +| CPU hog | Sample and kill processes exceeding a CPU threshold | |
| 18 | +| RAM hog | Kill processes over a memory limit | |
| 19 | +| Hung apps | Detect and kill frozen/unresponsive windows | |
| 20 | +| LLM/AI killer | Kills Ollama, LM Studio, Fooocus, KoboldCPP, etc. | |
| 21 | +| Game killer | Kills Steam, Epic, Xbox, Ubisoft Connect, and running games | |
| 22 | +| Restart | Kill and relaunch a process | |
| 23 | +| Self-protection | Never kills itself | |
| 24 | +| Colour output | ANSI colour with dry-run safety net | |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## Quick Start |
| 29 | + |
| 30 | +Download `killall.exe` from [Releases](../../releases), drop it anywhere in your PATH, done. |
| 31 | + |
| 32 | +Or build from source — see [Building](#building). |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +## Usage |
| 37 | + |
| 38 | +``` |
| 39 | +killall <pattern> [options] |
| 40 | +killall <subcommand> [options] |
| 41 | +``` |
| 42 | + |
| 43 | +### Pattern Matching |
| 44 | + |
| 45 | +| Syntax | Type | Example | |
| 46 | +|---|---|---| |
| 47 | +| `notepad` | Substring (case-insensitive) | matches `notepad.exe` | |
| 48 | +| `note*` | Glob wildcard | matches `notepad.exe`, `notepadpp.exe` | |
| 49 | +| `/^steam/` | Regex | matches processes starting with `steam` | |
| 50 | + |
| 51 | +### Options |
| 52 | + |
| 53 | +``` |
| 54 | +-t, --tree Kill process and all its children |
| 55 | +-f, --force Skip confirmation prompt |
| 56 | +-n, --dry-run Show what would be killed without killing |
| 57 | +--cmdline <pat> Match command-line substring or /regex/ |
| 58 | +--module <dll> Match processes with a specific DLL loaded |
| 59 | +--port <N|A-B> Match processes using a TCP/UDP port or range |
| 60 | +--window <title> Match by visible window title (substring or /regex/) |
| 61 | +--parent <pid|name> Match children of a specific parent process |
| 62 | +--top <N> Limit ramhog/cpuhog to top N offenders |
| 63 | +--sample <N> CPU sampling duration in seconds (default: 2) |
| 64 | +-h, --help Show help |
| 65 | +``` |
| 66 | + |
| 67 | +### Subcommands |
| 68 | + |
| 69 | +``` |
| 70 | +hung Kill hung/frozen applications |
| 71 | +networkapps Kill all processes with network connections |
| 72 | +ramhog <MB> Kill processes using more than N MB of RAM |
| 73 | +cpuhog <percent> Kill processes using more than N% CPU (per core) |
| 74 | +gpu [--threshold N] Kill processes using the GPU |
| 75 | +llm Kill local AI/LLM processes |
| 76 | +game Kill games, launchers, and gaming services |
| 77 | +restart <name> Kill a process then relaunch it |
| 78 | +``` |
| 79 | + |
| 80 | +--- |
| 81 | + |
| 82 | +## Examples |
| 83 | + |
| 84 | +```bat |
| 85 | +:: Kill all Notepad windows |
| 86 | +killall notepad |
| 87 | +
|
| 88 | +:: Kill Chrome and every child process it spawned |
| 89 | +killall chrome --tree |
| 90 | +
|
| 91 | +:: See what's on port 8080 before killing it |
| 92 | +killall --port 8080 --dry-run |
| 93 | +killall --port 8080 --force |
| 94 | +
|
| 95 | +:: Kill anything holding a port range |
| 96 | +killall --port 3000-3010 --force |
| 97 | +
|
| 98 | +:: Kill by command-line content (useful for Python scripts) |
| 99 | +killall --cmdline fooocus --force |
| 100 | +killall --cmdline /server\.py$/ --force |
| 101 | +
|
| 102 | +:: Kill processes with a specific DLL loaded |
| 103 | +killall --module msedge.dll --dry-run |
| 104 | +
|
| 105 | +:: Kill by window title |
| 106 | +killall --window "Untitled" --force |
| 107 | +
|
| 108 | +:: Kill all children of a process |
| 109 | +killall --parent explorer --dry-run |
| 110 | +
|
| 111 | +:: Kill the top 3 RAM hogs over 500 MB |
| 112 | +killall ramhog 500 --top 3 --dry-run |
| 113 | +
|
| 114 | +:: Kill CPU hogs over 80% (per core), sampling for 3 seconds |
| 115 | +killall cpuhog 80 --sample 3 --top 5 |
| 116 | +
|
| 117 | +:: Kill all local LLMs (Ollama, LM Studio, KoboldCPP, Fooocus, etc.) |
| 118 | +killall llm --force |
| 119 | +
|
| 120 | +:: Kill all games and launchers (Steam, Epic, Xbox, Ubisoft, etc.) |
| 121 | +killall game --force |
| 122 | +
|
| 123 | +:: Kill and restart a process |
| 124 | +killall restart explorer |
| 125 | +
|
| 126 | +:: Kill hung/frozen applications |
| 127 | +killall hung --force |
| 128 | +``` |
| 129 | + |
| 130 | +--- |
| 131 | + |
| 132 | +## LLM / AI Detection |
| 133 | + |
| 134 | +`killall llm` detects AI processes by: |
| 135 | + |
| 136 | +- **Process name:** `ollama`, `lm studio`, `koboldcpp`, `jan`, `gpt4all`, `oobabooga`, `localai`, `vllm`, `whisper`, and more |
| 137 | +- **Command line:** `.gguf`, `.ggml`, `.safetensors`, `.ckpt` model files |
| 138 | +- **Command line:** `fooocus`, `comfyui`, `webui.py`, `stable-diffusion`, `invokeai`, `kohya`, and others |
| 139 | + |
| 140 | +## Game Detection |
| 141 | + |
| 142 | +`killall game` detects games by: |
| 143 | + |
| 144 | +- **Process name:** `steam`, `epicgameslauncher`, `xboxpcapp`, `upc`, `galaxyclient`, `blizzard`, `eadesktop`, `riotclientservices`, `minecraft`, and more |
| 145 | +- **Loaded DLLs:** `steam_api64.dll`, `unityplayer.dll`, `easyanticheat.dll`, `nvngx_dlss.dll`, `bink2w64.dll`, and others |
| 146 | + |
| 147 | +--- |
| 148 | + |
| 149 | +## Building |
| 150 | + |
| 151 | +### Requirements |
| 152 | + |
| 153 | +- Windows 10/11 |
| 154 | +- [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) with **Desktop development with C++** workload |
| 155 | + (or just the free **Build Tools for Visual Studio 2022**) |
| 156 | + |
| 157 | +### Build |
| 158 | + |
| 159 | +```bat |
| 160 | +git clone https://github.com/YOUR_USERNAME/killall-windows |
| 161 | +cd killall-windows |
| 162 | +build.bat |
| 163 | +``` |
| 164 | + |
| 165 | +### Install |
| 166 | + |
| 167 | +```bat |
| 168 | +:: Run as Administrator for system-wide install (System32) |
| 169 | +:: Or run as normal user for per-user install (~\AppData\Local\Programs\killall) |
| 170 | +install.bat |
| 171 | +``` |
| 172 | + |
| 173 | +--- |
| 174 | + |
| 175 | +## How It Works |
| 176 | + |
| 177 | +| Feature | Windows API Used | |
| 178 | +|---|---| |
| 179 | +| Process enumeration | `CreateToolhelp32Snapshot` | |
| 180 | +| Process termination | `TerminateProcess` | |
| 181 | +| Process tree | `PROCESSENTRY32.th32ParentProcessID` traversal | |
| 182 | +| Command line | WMI `Win32_Process.CommandLine` | |
| 183 | +| Loaded modules | `CreateToolhelp32Snapshot (TH32CS_SNAPMODULE)` | |
| 184 | +| Network ports | `GetExtendedTcpTable` / `GetExtendedUdpTable` (IPv4 + IPv6 + UDP) | |
| 185 | +| Window title | `EnumWindows` + `GetWindowText` | |
| 186 | +| Hung detection | `SendMessageTimeout(WM_NULL, 2000ms)` | |
| 187 | +| Memory usage | `GetProcessMemoryInfo` | |
| 188 | +| CPU usage | Two-snapshot `GetProcessTimes` delta | |
| 189 | +| GPU detection | Checking for D3D/DXGI/Vulkan/CUDA DLL presence | |
| 190 | +| Process restart | `QueryFullProcessImageNameW` + `ShellExecuteA` | |
| 191 | + |
| 192 | +--- |
| 193 | + |
| 194 | +## Notes |
| 195 | + |
| 196 | +- Processes running as **SYSTEM** (e.g. `gamingservices.exe`, `steamservice.exe`) require running killall as **Administrator** to terminate |
| 197 | +- `killall` never kills its own process (self-protection built in) |
| 198 | +- All pattern matching is case-insensitive |
| 199 | +- `cpuhog` reports per-core CPU percentage (same as Task Manager per-process view) |
| 200 | + |
| 201 | +--- |
| 202 | + |
| 203 | +## License |
| 204 | + |
| 205 | +MIT |
0 commit comments