Как остановить команду в cmd
Перейти к содержимому

Как остановить команду в cmd

  • автор:

У вас большие запросы!

Точнее, от вашего браузера их поступает слишком много, и сервер VK забил тревогу.

Эта страница была загружена по HTTP, вместо безопасного HTTPS, а значит телепортации обратно не будет.
Обратитесь в поддержку сервиса.

Вы отключили сохранение Cookies, а они нужны, чтобы решить проблему.

Почему-то страница не получила всех данных, а без них она не работает.
Обратитесь в поддержку сервиса.

Вы вернётесь на предыдущую страницу через 5 секунд.
Вернуться назад

Is there a keyboard shortcut to pause the output of a CMD window while it’s running?

enter image description here

I’m in the middle of running a batch script that’s taking a really long time and whose output is whizzing by at an unreadable rate. Is there a keyboard shortcut that allows you to pause the CMD console where it currently is to stop and read the output, and then re-start it again from the same place?

asked Nov 14, 2016 at 2:55
Hashim Aziz Hashim Aziz
12.4k 36 36 gold badges 105 105 silver badges 178 178 bronze badges
There’s always CTRL-S. Then CTRL-Q to re-start.
Nov 14, 2016 at 3:15

You can grab the scroll box and move it up, this will effectively pause the scrolling. You can then hit the down arrow key to move to the bottom of the buffer.

Nov 14, 2016 at 5:12
Isn’t this the intended purpose of the «Scroll Lock» key?
Nov 26, 2016 at 1:57

7 Answers 7

I didn’t see this in the other answers.

I believe the serial control sequences of ‘Ctrl-S’ XOFF and ‘Ctrl-Q’ XON are the key sequences intended to solve the issue.

answered Nov 26, 2016 at 1:44
286 2 2 silver badges 1 1 bronze badge

I changed this to best answer for a few reasons. From research, the Pause/Break key on its own halts output, but not execution, which the other answer makes no mention of. Ctrl + Pause/Break must be used to halt execution, and this is slightly more cumbersome to type on most keyboards than Ctrl+S and Ctrl+Q (can be done with solely the left hand). That said, Ctrl + Pause/Break has the advantage that it doesn’t need you to remember two extra keybindings, so both answers are good, I’d just like to see this one get the upvotes it deserves.

Mar 6, 2018 at 23:24

Note that although this answer sources a Unix/Linux question, the keybindings work fine on CMD.exe, at least on my Windows 7 OS.

Mar 6, 2018 at 23:26

@Hashim, thanks for sharing your research. Because you specifically asked how to pause output, I didn’t consider (nor tested) this possibility, but it is nice to learn of. (Upvoted)

Feb 15, 2019 at 21:31

Does your keyboard contain the Pause/Break key? It would serve well for this. Here’s what it looks like, or at least used to:

Pause Break Key from Wikipedia

As an interesting bonus, this key can also be used during POST (Power On Self Test, which runs when the computer is turned on) to read output from the BIOS.

If you don’t have that key, the combination Control + NumLock should work just the same, and there are other options depending on your manufacturer, according to Wikipedia.

To resume execution, press Enter .

answered Nov 14, 2016 at 3:12
1,497 4 4 gold badges 23 23 silver badges 52 52 bronze badges

Note on some keyboards you may have the a specific scroll lock key (usually marked ScrLk ), which can serve a similar purpose.

Nov 14, 2016 at 5:14

@BurhanKhalid Well, I read on that link that it pauses output, but not execution, and this effect seems to not apply to the MS Windows console. but cool to know nevertheless

Nov 14, 2016 at 5:19

With ping, it appears to stop execution. that’s very odd, since ping is a discrete executable. additionally when paused, the ping.exe process remains in process explorer until it is allowed to complete. while paused, all its threads go into Wait:Executive , and doesn’t seem to pulse periodically. Fascinating.

Nov 14, 2016 at 7:44

Another trick that i like to use is to mark some text with the mouse (i always have quickedit mode enabled). That halts output (and hence execution, since a program that writes to stdout waits until the stream is written), too.

Nov 14, 2016 at 13:58

You can use «more» command. Though it is not exactly what you are looking for, it will limit screen output by a page.

answered Nov 14, 2016 at 13:46
Rooparsh Kalia Rooparsh Kalia
51 2 2 bronze badges

This is the best solution because pausing the output at the right moment is pretty much impossible given the speed at which output is generally produced. For clarification you have to use a pipe after your command followed by MORE. For example NETSH HTTP SHOW SSLCERT | MORE

Jun 13, 2018 at 17:43
Windows does not have ‘more’ native
Apr 16, 2019 at 14:59
@KumarAnkit It works for me in Win10: tasklist | more
Nov 2, 2023 at 13:00

Adding one more useful way for linux shells. (But maybe ok in windows too, try it!)

Presssing ctrl + z will hang the program. (Message: stopped)

To run it back again at his previous state, like if it were paused:

Type fg

Or for multiple usage: fg program_name_previously_ctrl+z_stopped`

answered Mar 27, 2018 at 22:54
271 2 2 silver badges 6 6 bronze badges

On windows systems, if the output screen has enabled Quick Edit Mode (by Configuration) just click on the screen and select any part of the screen. The program will stop execution until you right-click on the screen to un-select. The screen can lose focus and it will continue to be frozen until you come back and right click on it. Beware that any content of the Clipboard, if any, can be turned over that screen when you right click on it.

answered Jan 26, 2020 at 10:53
133 4 4 bronze badges

To get quick edit mode: Open CMD window > right-click on title bar > Properties > Options tab > check QuickEditMode

Nov 2, 2023 at 13:33

There are a couple other methods here to add, if we’re being thorough:

1) In addition to the Pause/Break button you can duplicate it’s functionality by Using «CTRL+C».

This will cause the cmd script to pause and ask you if you would like to terminate it. Once you are done looking you can select «NO» (or perhaps yes if it suits you) and it will continue (Or exit, if you chose yes).

2) You can ALSO pause using the mouse by clicking your mouse cursor in the window to select text from the CMD Terminal.

You may have noticed this pausing output in the past and thought only the output to be delayed, however when scripts are running in interactive cmd instances you are actually pausing the execution of the code (The same as with «Pause/Break» and «CTRL+C» Methods).

However once the window loses focus, or you click to unpause things, the code execution will continue, and you have no option to end the code through this manner.

У вас большие запросы!

Точнее, от вашего браузера их поступает слишком много, и сервер VK забил тревогу.

Эта страница была загружена по HTTP, вместо безопасного HTTPS, а значит телепортации обратно не будет.
Обратитесь в поддержку сервиса.

Вы отключили сохранение Cookies, а они нужны, чтобы решить проблему.

Почему-то страница не получила всех данных, а без них она не работает.
Обратитесь в поддержку сервиса.

Вы вернётесь на предыдущую страницу через 5 секунд.
Вернуться назад

У вас большие запросы!

Точнее, от вашего браузера их поступает слишком много, и сервер VK забил тревогу.

Эта страница была загружена по HTTP, вместо безопасного HTTPS, а значит телепортации обратно не будет.
Обратитесь в поддержку сервиса.

Вы отключили сохранение Cookies, а они нужны, чтобы решить проблему.

Почему-то страница не получила всех данных, а без них она не работает.
Обратитесь в поддержку сервиса.

Вы вернётесь на предыдущую страницу через 5 секунд.
Вернуться назад

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *