How to force close a program using PowerShell

Windows Articles

How to access System in Windows 10

Perhaps the title of this post is misleading. In previous versions of Windows, it was enough to enter the Control Panel and from there,...

Microsoft reduces the fragmentation of Windows 10

Windows 10 20H2 has been released as a minor operating system update. As a result, it has managed to reduce platform errors. In addition,...

How to install Nginx and PHP on FreeBSD?

Hello, friends. FreeBSD is a secure system even more than Linux, that's why it's used as the main server. And a server has to...

How to enable local port forwarding using Ubuntu 20.04 and ssh

SSH, a very popular tool found almost with every IT guy. Commonly, when we talk about the insecure network for data, ssh is the...

How to use CHKDSK in Windows 10

Hello! It is very important to ensure the integrity of the hard disk in the computer. Since it is an essential element for the...
Mel Khamlichi
Mel Khamlichihttp://www.osradar.com
Founder of Osradar, from Amsterdam Netherlands

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.

Enabling the PID in the open processes.
Enabling the PID in the open processes.

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:

Please launch a PowerShell with administrator privileges.
Please launch a PowerShell with administrator privileges.

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.

Stopping a process from PowerShell
Stopping a process from PowerShell

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.

Stopping a process using its name in PowerShell
Stopping a process using its name in PowerShell

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.

Closing a program
Closing a 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 processes
Force close program processes

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

Conclusion

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!

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to access System in Windows 10

Perhaps the title of this post is misleading. In previous versions of Windows, it was enough to enter the Control Panel and from there,...

Microsoft reduces the fragmentation of Windows 10

Windows 10 20H2 has been released as a minor operating system update. As a result, it has managed to reduce platform errors. In addition,...

How to install Nginx and PHP on FreeBSD?

Hello, friends. FreeBSD is a secure system even more than Linux, that's why it's used as the main server. And a server has to...

How to enable local port forwarding using Ubuntu 20.04 and ssh

SSH, a very popular tool found almost with every IT guy. Commonly, when we talk about the insecure network for data, ssh is the...

How to use CHKDSK in Windows 10

Hello! It is very important to ensure the integrity of the hard disk in the computer. Since it is an essential element for the...
x