Skip to main content

Posts

Showing posts with the label PowerShell kill all notepad services

PowerShell kill all notepad services or using pid

It's easy to fall into the habit of using multiple Notepad windows for various note-taking and reading needs. The convenience of having separate windows for different types of information can be surprisingly addictive. At the end of the day, you might have quite a few notepad and closing them one by one is not practical or ideal. Scripting or using PowerShell comes in handy in such scenario. Example of a PowerShell code snippet to kill all running notepad on the system. Get-Process -Name "*notepad*" | Stop-Process Above code snippet, get all notepad processes and is pipe to stop-process that will close the notepad. To just list the process of all running processes on the system, run this PowerShell code snippet. Get-WmiObject -Class Win32_Process | select "ProcessName", "ProcessID" To kill or close the process using a PID, run the command beloww: Stop-Process -Id 4365 -Force Or use -whatif parameter to see what will happen. Example: stop-pr...