How can I force stop a program without using the mouse in Windows 10?
Solution 1
You can use the command prompt to terminate processes:
- Open the Run box using Windows+R.
- Type
cmd
in the Run box and click Enter. - Use the command
tasklist
to list all processes. - Use the command
taskkill /F /IM "executable name.exe" /T
to terminate the process.
Solution 2
Try the following:
- Open the Task Manager by pressing Ctrl+Shift+Esc
- Navigate using the arrow keys (↓ and ↑) to highlight the problematic process
- Press the Delete key to kill the process
- If necessary, acknowledge the subsequent prompt by selecting the appropriate choice with the arrow keys (← or →) and press Enter
Solution 3
A slight modification of the Taskkill answer: You can use wildcard if you don't remember/know the exact full name of the process, like so:
taskkill /f /im badproce*
It will kill all executables starting with that name, so make sure you don't just type something like s*
because that could obviously kill critical processes like svchost
.
Also, the /T
flag is for killing the tree of processes, which is the target process and all the child processes it spawned. It may not be necessary most of the time.
Solution 4
Microsoft/Sysinternals' pskill
tool can be used to kill a process via a command prompt, and it allows you to kill processes by process ID numbers or by process name. It also can be used to kill processes remotely: if the misbehaving program also managed to prevent you from using the keyboard, you could install pskill
on another machine on your local network to kill the offending process.
Solution 5
You can kill the process from another device.
Alternative A: In "Settings -> For Developers -> Enable Device Portal". If you enable it, you get a web portal you can access from any other web-browsable device. With it you can list the running processes, and according to the documentation:
On some platforms (Desktop, IoT, and HoloLens) you can terminate processes.
Unfortunately, it currently doesn't seem to work on my computer, clicking on the "X" buttons besides each process does nothing.
Alternative B: If you have a Windows Mobile or another windows device, you can install the VoiceWake app from the Store, and its server component on your computer. Then you can use the app to kill the process remotely.
And there are certainly other applications out there that does the same.
Related videos on Youtube
Kyle Delaney
Updated on September 18, 2022Comments
-
Kyle Delaney over 1 year
I'm trying to debug a Visual Studio C# Windows application that immediately takes over the desktop and disables mouse control. When it freezes, I need to be able to stop it somehow. I can press the windows key or ctrl-alt-delete and access the taskbar, but when I move the mouse onto the main part of my screen it's always an hourglass icon and I can't interact. So when I right-click to close the application on the taskbar and a dialogue pops up asking if I want to stop debugging, there's no way for me to click it. I also can't click on anything in task manager.
I looked into how to end tasks from command prompt, but the directions don't make sense.
schtasks /end
requires a task name argument that seems to take a path, but I have no way of knowing what the path is that I'm supposed to input.tasklist
returns file names and ID numbers, but neither of those work forschtasks
.Does anyone have any suggestions?
-
Ramhound about 7 yearsALT+F4 will close any program on Windows
-
nanofarad about 7 years@Ramhound Alt+F4 will send a window-close message to the application. If it's unwilling to handle it (e.g. by dropping the event or doing something else) this won't work.
-
Carey Gregory about 7 years@Ramhound It won't close non-GUI programs or programs that choose to ignore the close event.
-
Džuris about 7 yearsIf the problem is that a dialogue pops up that can't be manipulated with mouse, you might simply be able to navigate it's buttons by tab or arrow keys and press them with space or enter.
-
JDługosz about 7 yearsYes, use the space and enter after the dialog box appears.
-
Display Name about 7 yearspull the plug, afaik this worked for all versions of windows.
-
BlueCacti about 7 yearsUsing Ctrl+Alt+Del, Ctrl+Shift+Esc, Win+R and so one don't necessarily require you to use your mouse. Almost all of Windows's functionalities can be used using the keyboard only. For this, you can use the arrow keys, the tab key, or Alt key navigation.
-
xDaizu about 7 yearsCtrl+Alt+Delete and then you need to exercise your Tab Fu
-
Daniel R Hicks about 7 years@SargeBorsch - Doesn't work for my laptop.
-
Display Name about 7 years@DanielRHicks does it have removable battery?
-
mcalex about 7 years
Alt+F, x
is my first goto. -
mbomb007 about 7 years@mcalex This doesn't work if an application is unresponsive.
-
-
Ismael Miguel about 7 yearsOr just type
cmd /C taskkill /f /im "<whatever>" /t
in the "Run" window. -
wizzwizz4 about 7 yearsYou will need Del -> Enter; there's a prompt.
-
MJ9 about 7 years@IsmaelMiguel Yes, but you can't do tasklist in Run.
-
CodesInChaos about 7 years@MJ9 You can, you just need to be a very quick reader :P
-
Ismael Miguel about 7 years@MJ9 The name of the process will be directly related to the name of the project. Since it is with the Visual Studio C#, the name of the process will be
<project>.vshost.exe
. If my project is calledWindowsFormsApplication1
, then the process to kill isWindowsFormsApplication1.vshost.exe
. There's no need fortasklist
. -
Run5k about 7 years@wizzwizz4 thanks for the feedback! That is a very good point. There isn't an additional prompt in some cases, but a program that is frozen will typically have one. I have added an additional step to the answer.
-
wizzwizz4 about 7 yearsIn my version of Task Manager (Win 10 Home), the Delete key to kill a process pops up with the "are you sure you want to do this? this could pwn your system" message. I'd be interested to know which systems this doesn't always appear for.
-
wizzwizz4 about 7 years@IsmaelMiguel You don't even need the
cmd /C
part;taskkill
isn't a shell built-in. -
Run5k about 7 years@wizzwizz4 I think it also depends upon your target. On my Windows 10 Pro x64 machine I have tried it on Notepad, Paint, and the Settings app. Each of them closes without any additional prompts.
-
Ismael Miguel about 7 years@wizzwizz4 OMG! You're totally right! You can straight type
taskkill
there! I forgot that it is an executable placed insidesystem32
(if I remember correctly). This means, a huge reduction of steps. And once you've done this once, all you have to do isWin + R
and then hitEnter
. -
Kyle Delaney about 7 yearsThis works! Thank you. I have a few choices for the correct answer here. I hope you don't mind me picking one with fewer votes. The arrow keys wouldn't respond the first time I tried your solution, so I'm going to say the other one is more consistent, and it has some good info about using the command prompt.
-
Kyle Delaney about 7 yearsThis is a very clever idea! I'd prefer not to take the time to test it though, since I already have some working solutions. I think this is a good fallback in a situation where the keyboard doesn't respond.
-
wizzwizz4 about 7 years@Run5k That could be it; I rarely have to terminate the built-in programs apart from the Settings app, and that might well have closed without a prompt.
-
user2428118 about 7 years@MJ9 "can't do tasklist in Run"
cmd /K tasklist
-
user2428118 about 7 yearsAlso, if you have the ID but not the name as in OP's post, you can do
taskkill /PID <process id>
-
tvdo about 7 years@wizzwizz4 Depends... on Windows 10, the "Processes" tab is closer to the Windows 7 "Applications" tab and it defaults to "End task" (which will try a safe exit first). It normally won't prompt. If you try to end a critical system process, it'll prompt you to shut down instead. However, if you use the "Details" tab (closer to Windows 7 "Processes"), you'll get the old "End process" (which goes and terminates it immediately) option and prompts.
-
wizzwizz4 about 7 yearsI think that's exactly what's happened; I always use the Details tab, but that isn't described in the answer.
-
phuclv about 7 yearsno need for
cmd /c
-
phuclv about 7 yearswhy do you need to run
tasklist
? wildcards can be used with/IM
options -
Mixxiphoid about 7 yearsIn addition you can type the name of the program to highlight it. I always use this method to kill apps, also when the task manager is hidden behind the hanging app, this still works.
-
Mixxiphoid about 7 yearsWhat is the MAJ key? Do you mean Shift?
-
Goufalite about 7 yearsOops! Correct! Editing my answer
-
Codingale about 7 yearsIf I recall, it ignores important processes at least on Windows 10. I didn't know that it accepted a wildcard. Thanks.
-
xDaizu about 7 years@IsmaelMiguel Why don't you update your answer without the cmd part? Or add it as an alternative for completeness? :)
-
Run5k about 7 years@wizzwizz4 there is certainly nothing wrong with utilizing the
Details
tab, but I didn't describe it within my answer because I tried to keep the proposed solution rather simple and the Windows 10 Task Manager will open to theProcesses
tab by default. Along the same lines, if you have yourUAC
turned up to the highest setting you will need to acknowledge the prompt after you initially press Ctrl+Shift+Esc, but that isn't the default configuration so I didn't include it accordingly. -
Ismael Miguel about 7 years@xDaizu That was already suggested and brushed off by me. Most of the content is already present in this answer, so, there's no need to repeat it. What I'm proposing (and that was refined by wizzwizz4) is just skipping steps. It isn't enough to make it into an answer.
-
Ismael Miguel about 7 years@LưuVĩnhPhúc Trust me, you don't want that. If you start killing random stuff, you kill stuff you need.
-
xDaizu about 7 years@IsmaelMiguel I know, I was not suggesting a new answer, but a small edit. You know, you leave your answer as is, add an horizontal line and add the "improvement" (crediting @wizzwizz4) :)
-
Ismael Miguel about 7 years@xDaizu But it isn't my answer...
-
xDaizu about 7 years@IsmaelMiguel It's an ´improvement/alternative` built upon your answer, so you can include it. There's plenty of precedent here in Stack Overflow. If you want to update it. In the end it's your choice, of course :)
-
Greenstone Walker about 7 yearsA quicker way to get an administrative cmd prompt (or PowerShell prompt, depending on how you've set it up) is to press Windows+X then A.
-
Alex Ljamin about 7 yearsDoes your method work in Windows 10? OP asks specifically about Windows 10 (see the Windows 10 tag). Update your answer if it works in Windows 10 or remove it.
-
TOOGAM about 7 years@alljamin : sure. This is CUA (Common User Application) equivalent of pressing Alt to get a menu. And CUA is widely supported by many Windows applications. (other examples: Shift-Del for cut, Shift-Ins for insert.) Widely supported, including Windows 10.
-
RJFalconer about 7 years
Alt+Space,C
is a similar approach. -
nardnob about 7 yearsYou can do "tasklist | sort" to have the tasklist sorted alphabetically
-
Run5k about 7 years@KyleDelaney you are quite welcome! Regarding the arrow keys, I actually tested this scenario ~100 times utilizing three different Windows 10 machines and it worked every time. I did test the process by "accidentally" hitting another key, and at times it appeared as though the arrow keys wouldn't respond. The answer you chose is a good one, and I was already aware of that method. My goal was to propose a solution for the community's benefit that was fast, reliable, and as simple as possible. However, whichever you prefer is the best solution and we are always glad to help!
-
Ismael Miguel about 7 years@GreenstoneWalker Your solution doesn't seem to work on Windows 7.
Windows + X
doesn't do anything on my PC (Windows 7 Ultimate x64 pt-pt). TheWindows + R
is available since (according to en.wikipedia.org/wiki/Run_command) Windows 95. Maybe it was introduced on Windows 8/8.1? -
Greenstone Walker about 7 years@Ishmael, the question is tagged "Windows 10". The Windows X menu was, as you surmise, added in Windows 8. You would not believe how many times I try to use it in Win 7. :-)
-
Fabio says Reinstate Monica about 7 yearsThis reminds me of a very dumb thing I did when I started working: I had to write a script that killed some processes of which I had the PID, on a Unix machine. I don't remember the details, but I was parsing the output of
ps -ef
with a regex containing the PID, and if it matched I had to send akill -9
. Now, for some reason, my regex didn't match, so I tried to make it "broader". It didn't work. Then broader, then broader... Frustrated, I decided to try something that worked for sure, and I used/2/
as regex for the PID. Yay, it worked!kill -9
to all the PIDs containing2
... X_X -
Fabio says Reinstate Monica about 7 yearsI still remember my surprise when I hit enter and the shell I was using was closed. Then I realized what had happened. To top it off, kill doesn't work on processes of other users, but unfortunately we were like 20 people sharing the same account on that machine... It wasn't a funny day. The moral of the story is: if you use wildcards, pay a lot of attention!
-
Kyle Delaney about 7 years100 times? Goodness. How did you test having a frozen desktop?
-
Run5k about 7 years@KyleDelaney Needless to say, I didn't test while having a frozen desktop. Based upon your feedback, I was thoroughly testing how to "force stop a program without using the mouse in Windows 10" while targeting a wide variety of programs.
-
Tihomir S. about 5 yearsThanks, this saved me time so many times with some games which hang and will never crash (even after End Task) or let me use Task Manager properly (an issue where the game always steals focus). Only restarting or killing the app like this does the trick. EDIT: