Kill a process and its children by PID with taskkill

End a process and everything it spawned, using the numeric PID you looked up.

WindowsProcessesTerminaltaskkillMedium risk
Run taskkill /PID <PID> /T /F, replacing <PID> with the numeric process id you found — for example taskkill /PID 12345 /T /F.

01Command

Command
$ taskkill /PID <PID> /T /F

02What 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

RiskMedium risk
RequirementsAn elevated Command Prompt if the process belongs to another user or to a system service.
!Warning: Killing a process discards its unsaved state. Check that the PID really belongs to the program you want to stop — terminating a system service can force a reboot.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • taskkill — Microsoft Learn
    Microsoft · vendor-doc · 2026-09-21
    Evidence: /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 reference
    SS64 · technical · 2026-09-21
    Evidence: TASKKILL /PID pid /T /F terminates the given process and its child processes forcefully.

Last verified: 2026-09-22 · Category: System & Settings

06Related solutions