Kill a process and its children by PID with taskkill
End a process and everything it spawned, using the numeric PID you looked up.
01Command
$ taskkill /PID <PID> /T /F02What it does
taskkill targets a process by its numeric PID. /T also ends the child processes that process started — dev servers and Electron apps normally spawn several, and leaving them behind means the port stays occupied. /F forces termination instead of asking the process to exit cleanly. Get the PID first, e.g. with Get-NetTCPConnection -LocalPort 8080 | Select-Object OwningProcess, or from the Details tab of Task Manager.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- taskkill — Microsoft LearnEvidence: /PID <processid> specifies the process to terminate; /T ends the specified process and any child processes started by it; /F forces termination.
- taskkill — Windows CMD referenceEvidence: TASKKILL /PID pid /T /F terminates the given process and its child processes forcefully.
Last verified: 2026-09-22 · Category: System & Settings
06Related solutions
Register a recurring Windows task entirely from the command line — ideal for scripts, cleanup jobs, and monitoring probes you want to run unattended.
Use the System File Checker to verify every protected Windows system file against known-good copies and automatically replace the damaged ones.
Use Windows Package Manager to install, search, and upgrade thousands of applications from the community repository in one command.