- [SOLVED] How to Clear Command Prompt Screen Windows 10 [MiniTool News]
- Summary :
- Clear Command Prompt Screen with CLS Command
- Close Command Prompt and Open It Again to Clear Screen
- Clear Command Prompt Screen with Keyboard Shortcut?
- How to View Command Prompt Command History
- How to Save Command Prompt History
- What You Can Do with Command Prompt
- Organize Your Hard Drive Partitions
- Check and Repair Disk Errors
- Detect and Repair Corrupt System Files
- Verdict
- ABOUT THE AUTHOR
- Очистка экрана Clearing the Screen
- Пример 1 Example 1
- Пример 2 Example 2
- Пример 3 Example 3
- Как очистить командную строку
- How do you clear the console screen in C?
- 13 Answers 13
- Очистка пк от 95% мусора за считанные секунды. Скрытая функция Windows.
- Очистка с помощью командной строки:
- С помощью моей программки:
[SOLVED] How to Clear Command Prompt Screen Windows 10 [MiniTool News]
By Alisa | Follow | Last Updated December 16, 2019
Summary :
This post provides quick ways to clear Command Prompt (cmd.exe) screen in Windows 10. For troubleshooting Windows problems, MiniTool software also provides some free tools like free data recovery software, hard drive partition manager, PC backup software, etc.
Windows Command Prompt (cmd.exe) lets us quickly open applications, execute tasks, troubleshoot some Windows issues, etc. by typing command lines. After you type many command lines and finish the tasks, or type wrong command lines, how to clear Windows Command Prompt screen in Windows 10?
Check the easy ways below for how to clear CMD screen in Windows 10.
Clear Command Prompt Screen with CLS Command
After you open Command Prompt in Windows 10, and enter multiple command lines in the screen, you can type cls command line in Command Prompt window, and hit Enter button. This will clear the CMD screen in Windows 10. All typed previous commands in Command Prompt window will be cleared.
Close Command Prompt and Open It Again to Clear Screen
You can also close Command Prompt window and open again, it will also clear the Command Prompt screen in Windows 10.
Windows 10 repair, recovery, reboot, reinstall, restore solutions. Create Win 10 repair disk/recovery disk/USB drive/system image to repair Win 10 OS issues.
Clear Command Prompt Screen with Keyboard Shortcut?
If the Command Prompt window is cluttered and you want to clear the screen, you may wonder if there is a keyboard shortcut to easily clear it. Some online posts suggest using Alt + F7 keyboard shortcut to clear the command history. But I tried this way, it doesn’t work.
How to View Command Prompt Command History
After you type a series of command lines in Command Prompt window, you can type doskey /history command line, and hit Enter. This command will display all the commands you typed in the same sequence as you entered.
To view all command lines you entered in Command Prompt window after you access CMD, you can also press F7 key. This will pop up a window with a list of all previous typed command lines. You can use the Up and Down arrow key to select any command line in the list and press Enter to locate it.
Learn how to use the 10 best free Windows 10 backup and recovery tools to backup and restore Windows 10, and recover lost/deleted data from Windows 10 PC.
How to Save Command Prompt History
You can enter this command line doskey /HISTORY > filename.txt to save the commands history to a TXT, HTML, CSV, RTF file. You can enter a file name and a file extension. The file will be saved to the location where you execute this command.
What You Can Do with Command Prompt
You can use Windows Command Prompt to do many things. Below we introduces three common usages of Command Prompt. Press Windows + R, type cmd, and hit Enter to open Command Prompt.
Organize Your Hard Drive Partitions
You can run Windows Diskpart utility in Command Prompt to manage computer hard drive partitions.
You can type diskpart in Command Prompt window to open Windows Diskpart tool. Below is how to partition external hard drive with Diskpart.
- list disk
- select disk * (select the external hard disk)
- create partition primary size=* (specify a partition size in MB)
- assign letter=* (set a drive letter for the new partition)
- format fs=ntfs quick
- exit
Check and Repair Disk Errors
You can also type chkdsk *: /f /r command in Command Prompt, and hit Enter to use Windows CHKDSK to check and repair hard disk errors. Replace “*” with the target partition drive letter.
Detect and Repair Corrupt System Files
If your computer has problems, you can use Windows SFC tool to check and repair corrupted system files. You can type sfc /scannow command in Command Prompt, and hit Enter to use SFC tool to find and repair corrupted/missing system files.
Verdict
In conclusion, the easiest way to clear Command Prompt screen is to use CLS command or restart Command Prompt application.
How to fix my phone SD free? This post offers 5 ways for repairing corrupted SD card on (Android) phones, and help you easily restore SD card data and files in 3 simple steps.
ABOUT THE AUTHOR
Position: Columnist
Alisa is a professional English editor with 4-year experience. She loves writing and focuses on sharing detailed solutions and thoughts for computer problems, data recovery & backup, digital gadgets, tech news, etc. Through her articles, users can always easily get related problems solved and find what they want. In spare time, she likes basketball, badminton, tennis, cycling, running, and singing. She is very funny and energetic in life, and always brings friends lots of laughs.
Очистка экрана Clearing the Screen
Существует четыре способа очистки экрана в консольном приложении. There are four ways to clear the screen in a console application.
Пример 1 Example 1
Это рекомендуемый метод с использованием виртуальных последовательностей терминалов для всех новых разработок. This is the recommended method using virtual terminal sequences for all new development. Дополнительные сведения см. в обсуждении классических API консоли и виртуальных последовательностей терминалов . For more information, see the discussion of classic console APIs versus virtual terminal sequences .
Первый способ — настроить приложение для виртуальных выходных последовательностей терминала, а затем вызвать команду «очистить экран». The first method is to set your application up for virtual terminal output sequences and then call the «clear screen» command.
Дополнительные варианты этой команды см. в документации по виртуальным последовательностям, посвященной стиранию экрана . You can find additional variations on this command in the virtual terminal sequences documentation on Erase In Display .
Пример 2 Example 2
Второй метод — написать функцию для прокрутки содержимого экрана или буфера и задать заливку для видимого пространства. The second method is to write a function to scroll the contents of the screen or buffer and set a fill for the revealed space.
Это соответствует поведению командной строки cmd.exe . This matches the behavior of the command prompt cmd.exe .
Пример 3 Example 3
Третий метод заключается в написании функции для программного очистки экрана с помощью функций филлконсолеаутпутчарактер и филлконсолеаутпутаттрибуте . The third method is to write a function to programmatically clear the screen using the FillConsoleOutputCharacter and FillConsoleOutputAttribute functions.
Этот прием показан в следующем образце кода. The following sample code demonstrates this technique.
Как очистить командную строку
Используйте следующие команды для управления самим инструментом командной строки:
— cls — очистка командной строки;
— cmd — запуск копии командной строки;
— color — выбор цветового отображения фона и текста командной строки;
— prompt — редактирование текстового приглашения командной строки;
— title — выбор заголовка окна для текущего сеанса командной строки;
— exit — завершение работы инструмента командной строки.
Введите следующее значение в поле командной строки для получения информационных данных системы:
— driverquery — отобразить свойства и текущее состояние драйвера выбранного устройства;
— systeminfo — показать данные системы и конфигурации компьютера;
— ver — отобразить информацию о текущей версии операционной системы.
Измените необходимые параметры системы с помощью следующих команд:
— date — возможность редактирования текущей даты;
— schtasks — возможность создания расписания запуска программ или выполнения команд;
— shutdown — выключение комепьютера8
— taskkill — принудительное завершение работы выбранной программы или процесса;
— time — возможность редактирования данных системного времени.
Основными значениями команд командной строки принято именовать следующие:
— copy — копировать файл;
— del — удалить файл;
— find — найти текстовое значение в выбранном файле;
How do you clear the console screen in C?
Is there a «proper» way to clear the console window in C, besides using system(«cls») ?
13 Answers 13
Well, C doesn’t understand the concept of screen. So any code would fail to be portable. Maybe take a look at conio.h or curses, according to your needs?
Portability is an issue, no matter what library is used.
This function will work on ANSI terminals, demands POSIX. I assume there is a version that might also work on window’s console, since it also supports ANSI escape sequences.
There are some other alternatives, some of which don’t move the cursor to <1,1>.
For portability, try this:
Then simply call clrscr() . On Windows, it will use conio.h ‘s clrscr() , and on Linux, it will use ANSI escape codes.
If you really want to do it «properly», you can eliminate the middlemen ( conio , printf , etc.) and do it with just the low-level system tools (prepare for a massive code-dump):
A workaround tested on Windows(cmd.exe), Linux(Bash and zsh) and OS X(zsh):
Using macros you can check if you’re on Windows, Linux, Mac or Unix, and call the respective function depending on the current platform. Something as follows:
Since you mention cls , it sounds like you are referring to windows. If so, then this KB item has the code that will do it. I just tried it, and it worked when I called it with the following code:
There is no C portable way to do this. Although various cursor manipulation libraries like curses are relatively portable. conio.h is portable between OS/2 DOS and Windows, but not to *nix variants.
The entire notion of a «console» is a concept outside of the scope of standard C.
If you are looking for a pure Win32 API solution, There is no single call in the Windows console API to do this. One way is to FillConsoleOutputCharacter of a sufficiently large number of characters. Or WriteConsoleOutput You can use GetConsoleScreenBufferInfo to find out how many characters will be enough.
You can also create an entirely new Console Screen Buffer and make the current one.
Очистка пк от 95% мусора за считанные секунды. Скрытая функция Windows.
Все мы знаем что стандартная программа по очистке операционной системы не может полностью очистить весь мусор с диска, поэтому существует некая команда для CMD Windows которая позволяет очистить системный диск от мусора примерно на 95%.
Команду я оставлю чуть ниже, но для вашего же удобства я создал небольшую программу которая с помощью этой же команды позволит очистить ваш пк от всего мусора который мог копиться несколько лет. Но пусть будет 2 варианта очистки для вашего удобства:
Очистка с помощью командной строки:
1. Копируете вот эту команду «%systemroot%\system32\cmd.exe /c cleanmgr /sageset:65535 & cleanmgr /sagerun:65535»
2. Нажимаете сочетание клавиш «Win +R» и в окошке пишите «cmd», жмете «Ок»
3. Вставляете то что скопировали в открывшееся окно:
4. Нажимаете «Enter» и в открывшемся окне ставим все галочки и жмете «Ok»
5. Ждёте пока не закроются все окошки которое запустила эта команда, очистка может происходить от 3 секунд до 5 минут, зависит от того, сколько мусора было обнаружено.
С помощью моей программки:
Скачиваем программу по ссылке из комментариев к этой статье. После чего запускаем её, ставим все галочки и нажимаем «ОК».
Готово! Вы очистили свою систему от мусора! Не забудьте посмотреть на то, сколько свободного места у Вас на диске «C» до и после очистки. Напишите результат в комментариях!