Killing task by name - start menu shortcut
I have a problem with a specific application that I am executing. The application is full-screen in the foreground. About once per day, it hangs. When it does, I can only open start menu. I cannot kill the app through Task Manager, as Task Manager opens in the background. So, as the process always has the same name, I thought to put a "kill switch" for it into the start menu. However, on the internet I only find commands to kill by PID, and the PID changes fo each execution.
Any idea on that?
The /IM
parameter for taskkill does that. For example a link file with the target: C:\Windows\System32\cmd.exe /C "TASKKILL /IM notepad.exe"
would kill all processes with the name notepad.exe.
Create a batch file and use the command Taskkill, then create a shortcut to that batch file and place it in the Start Menu. So, write a batch along the lines of:
@ECHO OFF
taskkill /IM firefox.exe /F
Then create a shortcut link to it in the Start Menu.
/F
is to force terminate.
Reference: Microsoft Doc taskkill for syntax, The Windows Club article on How to force close a program for an example.
As that process takes over the entire screen, you cannot use desktop icons or the Start Menu. Some advice:
Use the keyboard shortcuts Alt+M or Alt+D to minimize the process. If that doesn't help:
Set the Task Manager to be topmost by its menu Options > Always on top
You may use the Task Manager menu File > Run a new task to run a command such as
taskkill /IM /F process.exe
to kill the process. Task Manager will remember the command so the next time you will not have to type it again.