12

I just upgraded to Windows 10 for a few days and have this error. I'm really sure that my computer doesn't have any program that takes control of Ctrl + C. How do i solve this and back to normal killing process like ping -t ...?

6
  • I usually have to hit Ctrl + C two or four times, (and perhaps enter a few times as well) to abort cli processes in win7's cmd and powershell environments. Aug 12, 2015 at 14:15
  • 2
    if you use CONTROL + BREAK instead does that work better? Aug 12, 2015 at 15:06
  • Part of the problem with PING in particular is that it won't immediately abort, but needs its latest echo to either recieve a response or to time-out. Aug 12, 2015 at 15:45
  • @DavidMoylan Some keyboards, like those on a couple of my laptops, don't have the Pause/Break key and on the laptop that does have the Pause/Break key (yes, it's runnijng Windows 10), Ctrl+Break does NOT kill the process.
    – edgerrr
    Aug 12, 2015 at 16:25
  • This drives me crazy, but one thing I do to get around this is prefix the command with start. For example: start ping -t ... It launches the command in its own window, and you can close it without closing the command window you started in.
    – Joe Skeen
    Jan 9, 2016 at 20:20

6 Answers 6

11

I had the same problem on Windows 10. Ctrl+BREAK worked for me.

3
  • 1
    On my Lenovo ThinkPad, I have to use Ctrl + Fn + P Jun 20, 2022 at 20:05
  • 2
    Or Ctrl+Pause. Pause is an alternative name of Break key.
    – ks1322
    Aug 23, 2022 at 10:51
  • For Dell Inspiron it is CTRL+Fn+B. Mar 19 at 8:24
7

One possibility is that you have changed the CMD (cmd.exe) defaults. To restore the defaults, right-click on the CMD window's title bar and choose "Defaults".

Although Ctrl+C works fine on my PC in normal mode, perhaps you have UAC disabled and need to run CMD in administrator mode in order for Ctrl+C to work. To run in CMD in administrator mode, click on "Search", type in "cmd", right-click on "Command Prompt (Desktop app)", and choose "Run as administrator".

3
  • 2
    +1 for me it only works when running command prompt as administrator, even after disabling CTRL key shortcuts in the options... very inconvenient.
    – Joe Skeen
    Jan 9, 2016 at 17:09
  • @JoeSkeen I have posted a solution myself, would be good to see if this sorts the issue for you. Jun 27, 2017 at 15:03
  • CMD is running in admin mode. "Defaults" opens a window and "Enable Ctrl key shortcuts" is checked yet Ctrl+c doesn't kill it. I'm running OS10 v1909 b18363.592. A superuser answer suggests right ctrl+c and another ctrl+break. Has Microsoft changed the keys again?
    – J.Money
    Feb 10, 2020 at 0:43
5

Just ran into this issue myself. It seems that when I return to cmd and left click in the black screen, the window title is prefixed with "Select" as though I am trying to highlight text. The first CTRL + C kills the select mode and the second CTRL + C kills the process. If I right click the window or left click the title bar as opposed to the window itself I do not get the "Select" event and CTRL + C works first time.

I believe you can also disable quick editing and this effectively stops you from highlights thus solving the issue if highlighting text in cmd is of no importance to you, the second alternative is just right click the window to reselect it.

1
  • 1
    Thank you so much, that helped me just then when I was pulling my hair out trying to figure out why Ctrl + C wouldn't stop the OpenRefine process, like their wiki explains it should! Double Ctrl + C does it.
    – stragu
    Mar 31, 2020 at 0:17
3

Beware that hitting [Ctrl]+[C] sends the prompt "Terminate batch job (Y/N)?" to STDOUT and the keypress ^C to STDERR.

If you run a script with script.bat >out 2>err you will never see the prompt. Prompt goes to out and keypress goes to err

Try pressing [Ctrl]+[c], [Y], [Enter].

The Microsoft answer would be: Use Powershell. But it has the same problem ;-)

1
  • Only answer that worked for me. Thanks.
    – Alaa M.
    Sep 10, 2022 at 19:12
1

Another possible cause is if you start cmd.exe with the start /b command, since that disables Ctrl+C, as the help text for start.exe says:

B           Start application without creating a new window. The
            application has ^C handling ignored. Unless the application
            enables ^C processing, ^Break is the only way to interrupt
            the application.

In my tests, I can't kill a start /b ping 8.8.8.8 with Ctrl+C. It looks like it's worked, because I see a prompt, but it's still pinging away in the background.

See this answer for how it was worked around in the Windows Terminal application.

1
  • Please do not post the same answer to multiple questions. If the same information really answers both questions, then one question (usually the newer one) should be closed as a duplicate of the other. You can indicate this by voting to close it as a duplicate or, if you don't have enough reputation for that, raise a flag to indicate that it's a duplicate. Otherwise tailor your answer to this question and don't just paste the same answer in multiple places.
    – DavidPostill
    Aug 2, 2022 at 14:33
-2

So here is what I did... MANY of you MUST right click and run as administrator.

I create a shortcut on my desktop, the target is CMD.

I right click the short cut, under properties I click ADVANCED on the shortcut tab.

Check the box that says "Run as administrator"

SOLVED.

I then moved the icon to my quicklaunch. Yes I have quicklaunch in Windows 10 b/c/ I am baller like that...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .