Stop-Process: find and stop a process in PowerShell
In short
- Stop-Process -Name stops all instances with that name, while -Id stops only the process with that PID1.
- Stop-Process doesn't ask for confirmation unless you add -Confirm, except for processes you don't own1.
- To stop a process that another user owns, start PowerShell with the Run as administrator option1.
- -Force stops the process without the confirmation prompt that appears for processes you don't own1.
- Stopping a process can stop processes and services that depend on it, and in an extreme case it can stop Windows1.
To stop a process in PowerShell, first find its name or process ID (PID) with Get-Process2. Then run Stop-Process -Name to stop every instance with that name, or Stop-Process -Id to stop one instance1. Add -WhatIf to see what would happen without stopping anything, or -Confirm to be asked before it stops1.
Syntax
Stop-Process picks a process by ID, by name or from a process object1. These are the two forms you will use most.
Stop-Process [-Id] <Int32[]> [-PassThru] [-Force] [-WhatIf] [-Confirm]
Stop-Process -Name <String[]> [-PassThru] [-Force] [-WhatIf] [-Confirm]-Idis one or more process IDs, separated by commas. To find a PID, runGet-Process1.-Nameis one or more process names, separated by commas. Wildcards are allowed1.-WhatIfshows what would happen if the cmdlet runs. The cmdlet is not run1.-Confirmasks you before the cmdlet runs1.-Forcestops the process without asking. Without it, Stop-Process asks before it stops a process that the current user doesn't own1.-PassThrureturns an object for the stopped process. By default, Stop-Process returns no output1.
Examples
Find the process first
Get-Process gets the processes on the local computer. You can name a process with -Name or pick one by PID with -Id2.
Get-Process -Name notepadIts default table includes the columns NPM(K), PM(M), WS(M), CPU(s), Id, SI and ProcessName. The Id column is the PID2.
Preview the stop with -WhatIf
Run the command with -WhatIf first. The cmdlet does not run1. PowerShell lists the operation and the items it would affect instead3.
Stop-Process -Name "notepad" -WhatIfStop every instance by name
This stops all instances of the Notepad process. Each instance runs in its own process, and they all share the same name1.
Stop-Process -Name "notepad"It returns nothing by default1.
Stop one instance by ID and confirm it
This stops only the process with ID 3952. -Confirm makes PowerShell ask before it stops the process, and -PassThru shows the stopped process1.
Stop-Process -Id 3952 -Confirm -PassThruMicrosoft shows this output1:
Confirm
Are you sure you want to perform this action?
Performing operation "Stop-Process" on Target "notepad (3952)".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help
(default is "Y"):y
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
41 2 996 3212 31 3952 notepadMicrosoft calls this best practice, because the prompt shows the process name as well as its ID1.
Pipe a process from Get-Process
You can pipe a process object to Stop-Process1. This lets you check the process with Get-Process, then stop the same one.
Get-Process -Name "notepad" | Stop-ProcessIt returns nothing by default1.
Stop a process you don't own
This needs a PowerShell window opened with Run as administrator1. Without -Force, PowerShell asks you to confirm. With -Force, the process stops without a prompt1.
Stop-Process -Id 3952 -ForceBe careful here. Stopping a process can stop processes and services that depend on it. In an extreme case, it can stop Windows1.
Common errors
Access is denied. Microsoft shows this message when a standard window tries to stop a process the user doesn't own1:
Stop-Process : Cannot stop process 'lsass (596)' because of the following error: Access is deniedIn that example, the process can be stopped only by a member of the Administrator group on the computer. Open PowerShell with Run as administrator and try again1.
Too many windows closed. -Name stops every instance with that name1. To stop just one, find its PID with Get-Process and use -Id1,2.
The process still shows up. Stop-Process runs asynchronously. Wait with the Wait-Process cmdlet, or check the HasExited property of the process object1.
Get-Process output won't pipe to Stop-Process. With -Module or -FileVersionInfo, Get-Process returns a different type of object. You can't pipe that output to a cmdlet that expects a process object, such as Stop-Process2.
You need to stop another PowerShell window, not this one. Several PowerShell processes can share one name. The $PID variable holds the ID of the process that hosts your current session, so you can tell it apart from the others2.
Questions
- Is there a kill command in PowerShell?
- Yes. On Windows, kill is an alias for Stop-Process. The alias spps works on all platforms1.
- How do I find the PID of a process?
- Run Get-Process. The Id column shows the process ID (PID) of each process2. To see who owns a process, add -IncludeUserName2.
- Can Stop-Process stop a process on another computer?
- No. Stop-Process works only on processes running on the local computer1.
- Do I need administrator rights to stop a process?
- Only for a process that the current user doesn't own. For those, start PowerShell with the Run as administrator option1.
14 Sept 2026: Published.