How to force close a program using PowerShell
Hi! We have mentioned in the past that Windows allows you to open multiple programs at once. In fact, that is one of the aspects that makes it more attractive to users. Inasmuch as, it makes it possible to use the computer for different tasks. That is, for leisure, work or study. However, these applications can fail or even stop completely. The reasons may be because of inconveniences with the software or incompatibility. It is also possible that it is caused by insufficient hardware resources. In any case, these problems can cause damage to the system. We showed you before how to force the closing of programs using the task manager. However, today we will see how to force close a program using PowerShell.
How to view program PID or process Windows 10
Sometimes, the problem with the program or applications is so strong, that it resists being closed via task manager. In those cases, it is possible to use the PowerShell to force the closing of the program. However, it is necessary to go to the task manager, using any of the methods I detail here. Once there, just right click on some columns in the Processes tab. Then, please activate the PID option.
As shown in the following image, each open process is with the PID:
How to force application shutdown in Windows 10 from PowerShell
The first thing you have to do is open a PowerShell with administrator privileges. With this in mind, please press the Win+X combination. Once the Quick Link menu is open, select the corresponding option:
Stopping a process with PID
After opening the console, it is necessary to use the following syntax.
Stop-Process -Id PID
Please remember to substitute PID for the value of the problem process. Sometimes, the console will ask you to confirm the order.
Back to the task manager, you can see that the process is no longer active.
Stop a process using its name
It is also possible to stop a process using its name. With this in mind, please use the following syntax.
Stop-Process -Name process name
Once again, remember to replace the process name with the corresponding value.
Force close program
We can use the taskkill command for this purpose. With this in mind, please run taskkill next to the program’s PID to close it:
taskkill /F /PID pid
Again, assign the corresponding PID to the program.
Force close program processes
It is possible to use taskkill to close all processes linked to a program. To do this, run the following:
taskkill /IM program.exe
Force close program with name
Another way to close a program is to use its name again. But this time forcing the task. With this intention, execute the following:
Stop-Process -Name program -force
Finally, we have seen how to force close a program using PowerShell. Also, along post we studied several options to close those frozen apps. This option is very useful, when the program refuses to close by the traditional method. All right, this is all for now. See you soon!