다음을 통해 공유


Ctrl-C doesn't work in RUNAS or MakeMeAdmin command shells

Repro:

· Use RunAs or MakeMeAdmin to get a CMD shell running in a different security context.

· Run “DIR /A /S C:\” to list every file and folder on the C: drive. 

· Try to stop the output with Ctrl-C. 

 

Result:

Nothing happens.  “DIR” continues to execute.

 

Workaround:

Use Ctrl-Break instead.

 

[Added, March 9, 2005:

While this problem occurs on Windows XP, it does not occur on Server 2003 RTM!

]

Comments

  • Anonymous
    February 09, 2005
    Oh yes… Stepped on that. Most annoying when a program such as ping or wget has alternate semantics on Ctrl+Break.

  • Anonymous
    February 09, 2005
    I recently discovered this also whilst doing a ping -t. The problem there is CTRL-BREAK doesn't break out of the ping but just shows the ping stats. Haven't worked out how to sort that one yet.

  • Anonymous
    February 14, 2005
    The comment has been removed

  • Anonymous
    February 16, 2005
    This was something I bugged with Microsoft a long time ago. Nice that it is still around.

  • Anonymous
    March 02, 2005
    reboot as 14997987. enter in to runas

  • Anonymous
    March 03, 2005
    "call doctor", what does your comment mean?

  • Anonymous
    March 07, 2005
    If anyone happens to discover the cure for CTRL-C or CTRL-BREAK when doing a ping -t that would be great. Obviously closing the window is an option but for some of us "effcient" folk it would be nice to keep that window.

  • Anonymous
    March 07, 2005
    The comment has been removed

  • Anonymous
    March 07, 2005
    Hah, nice one. That makes way too much sense.

  • Anonymous
    March 07, 2005
    Found the reason for Ctrl-Break doing what it does - it is by design. See KB article 325487 ("How to troubleshoot network connectivity problems"), http://support.microsoft.com/?id=325487 quoted here:
    "To watch Ping statistics, use the ping -t command. To see statistics and continue, press CTRL+BREAK. To stop, press CTRL+C."

  • Anonymous
    March 08, 2005
    The comment has been removed

  • Anonymous
    March 09, 2005
    Couple of quick comments:
    1. I just added a note that this is not a problem in Server, only in XP.
    2. Another workaround for the "ping -t" problem is that you don't need runas to run "ping -t" -- you can run it as the originally logged-on-user. Normal users can send ICMP packets just like admins!
    HTH

  • Anonymous
    March 10, 2005
    Good confirmation re: XP

    That's a valid point re: non-admin ping. I'll just have to start a little shock treatment to alter my behavior. ;)

    Thanks for the follow up!

  • Anonymous
    April 10, 2005
    If you have not read Jen's article on LUA, you should be asking yourself why not?

    This article...

  • Anonymous
    April 18, 2005
    Complete list of Aaron Margosis' non-admin / least privilege posts, for easy lookup.

  • Anonymous
    June 10, 2005
    Get your friends and family, all those folks that come to you for computer help once their machines have...

  • Anonymous
    June 28, 2005
    Find a solution...

    Just Press CTRL+Shift+C for having a C instead of a c

    CTRL+c --> don't work if capslock not engage

    CTRL+C --> work

  • Anonymous
    June 28, 2005
    Leviathan, did you actually try that "solution" before you posted it? It doesn't work.

  • Anonymous
    June 30, 2005
    Another choice is to run a different ping utility, like the one from <a href="http://www.cygwin.com">Cygwin</a>, or the excellent <a href="http://www.d3tr.de/">3d Traceroute</a>. I suppose I should wash my mouth out with soap now though, for suggesting a non-Microsoft, non-MSI, non-digitally-signed bit of software? grin

  • Anonymous
    June 30, 2005
    Sigh .. didn't realize HTML was verboten.
    Cygwin: http://www.cygwin.com
    3d Traceroute: http://www.d3tr.de/

  • Anonymous
    November 25, 2005
    The comment has been removed

  • Anonymous
    December 04, 2008
    Now I hit an entirely different issue: my Dell laptop has NO Pause/Attn key, so I can't break scripts running in a RUNAS'ed shell AT ALL... Any idea?

  • Anonymous
    December 11, 2009
    SOLUTION Type "Command" before the "pint -t" SOLUTION This opens the older shell that in not affected by the bug. [Aaron Margosis]  Joeviocoe, did you actually try that?  It doesn't work on an XP system I tried it on.