IT 442: Windows Operating System
How to Kill a Process in Windows
How to Kill a Process in Windows with Task Manager
- After opening Task Manager with “Ctrl + Shift + Esc”, press the “More details” button
- Select the process you want to kill and click “End task”
How to Kill a Process with the Taskkill Command
- Press the Windows key and type “Command Prompt”, then choose “Run as administrator”.
- Run the tasklist command
- You can get a quick readout of all the currently running processes, much like Task Manager,
by typing tasklist | more and pressing “Enter”
- Run the taskkill command to kill the process: Type "taskkill /F /PID x", where x is replaced by your process’ PID.
- taskkill /pid 993: Kill the task with PID 993
- OR: Use taskkill to kill a process by its name - "taskkill /IM "yourprocess.exe" /F"
- OR: Use taskkill to kill a process by its name - "taskkill /IM Nodepad.exe /F" or
"taskkill /f /im notepad.exe"
- OR: Use taskkill to kill a process by its name - "TASKKILL /S M001-BG004 /F /IM Magic_Console.exe"
- /S system : Specifies the remote system of where to connect.
- /U [domain\]user : Specifies the user context under which the command should execute.
- /P [password] : Specifies the password for the given user context. Prompts for input if omitted.
- /FI filter: Applies a filter to select a set of tasks. Allows "*" to be used. ex. imagename eq
acme* See below filters for additional information and examples.
- /PID processid: Specifies the PID of the process to be terminated. Use tasklist to get the PID.
- /IM imagename: Specifies the image name of the process to be terminated.
Use the wildcard '*' to specify all tasks or image names.
- /T: Terminates the specified process and any child processes which were started by it.
- /F: Specifies to forcefully terminate the process(es).
How to Terminate a Process with PowerShell
- Open PowerShell as an admin
- Press “Windows + X” to open the fly-out menu, then click “Windows PowerSSpecifies the image name of the process to be terminated. Use the wildcard '*' to specify all tasks or image names.hell (Administrator)”.
- Get a list of processes: In PowerShell, type "Get-Process" to have it return a list of all of the currently running processes on your PC and their PID.
- Use PowerShell stop process to kill the task: To stop the process, type the following, substituting the x for the relevant PID:
- "Stop-Process -ID x -Force "
- OR: Kill process by name in PowerShell - "Stop-Process -Name "YourPhone" -Force"
- Stop-Process -Name "YourPhone" -Force
Reference