Windows cmd clear command

Как очистить командную строку

Используйте следующие команды для управления самим инструментом командной строки:

— cls — очистка командной строки;

— cmd — запуск копии командной строки;

— color — выбор цветового отображения фона и текста командной строки;

— prompt — редактирование текстового приглашения командной строки;

— title — выбор заголовка окна для текущего сеанса командной строки;

— exit — завершение работы инструмента командной строки.

Введите следующее значение в поле командной строки для получения информационных данных системы:

— driverquery — отобразить свойства и текущее состояние драйвера выбранного устройства;

— systeminfo — показать данные системы и конфигурации компьютера;

— ver — отобразить информацию о текущей версии операционной системы.

Измените необходимые параметры системы с помощью следующих команд:

— date — возможность редактирования текущей даты;

— schtasks — возможность создания расписания запуска программ или выполнения команд;

— shutdown — выключение комепьютера8

— taskkill — принудительное завершение работы выбранной программы или процесса;

— time — возможность редактирования данных системного времени.

Основными значениями команд командной строки принято именовать следующие:

— copy — копировать файл;

— del — удалить файл;

— find — найти текстовое значение в выбранном файле;

Очистка экрана 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.

[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.

Читайте также:  Perfom exe что это за процесс windows 10

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.

Читайте также:  Распаковка файлов системы windows

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.

  • Facebook
  • Twitter
  • Linkedin
  • Reddit

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.

Windows cmd clear command

Starts a new instance of the command interpreter, Cmd.exe. If used without parameters, cmd displays the version and copyright information of the operating system.

Syntax

Parameters

Parameter Description
/c Carries out the command specified by string and then stops.
/k Carries out the command specified by string and continues.
/s Modifies the treatment of string after /c or /k.
/q Turns the echo off.
/d Disables execution of AutoRun commands.
/a Formats internal command output to a pipe or a file as American National Standards Institute (ANSI).
/u Formats internal command output to a pipe or a file as Unicode.
/t: < | > Sets the background (b) and foreground (f) colors.
/e:on Enables command extensions.
/e:off Disables commands extensions.
/f:on Enables file and directory name completion.
/f:off Disables file and directory name completion.
/v:on Enables delayed environment variable expansion.
/v:off Disables delayed environment variable expansion.
Specifies the command you want to carry out.
/? Displays help at the command prompt.

The following table lists valid hexadecimal digits that you can use as the values for and :

Value Color
0 Black
1 Blue
2 Green
3 Aqua
4 Red
5 Purple
6 Yellow
7 White
8 Gray
9 Light blue
a Light green
b Light aqua
c Light red
d Light purple
e Light yellow
f Bright white

Remarks

To use multiple commands for , separate them by the command separator && and enclose them in quotation marks. For example:

If you specify /c or /k, cmd processes, the remainder of string, and the quotation marks are preserved only if all of the following conditions are met:

You don’t also use /s.

You use exactly one set of quotation marks.

You don’t use any special characters within the quotation marks (for example: & ( ) @ ^ | ).

You use one or more white-space characters within the quotation marks.

The string within quotation marks is the name of an executable file.

If the previous conditions aren’t met, string is processed by examining the first character to verify whether it is an opening quotation mark. If the first character is an opening quotation mark, it is stripped along with the closing quotation mark. Any text following the closing quotation marks is preserved.

If you don’t specify /d in string, Cmd.exe looks for the following registry subkeys:

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun\REG_SZ

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun\REG_EXPAND_SZ

If one or both registry subkeys are present, they’re executed before all other variables.

Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer.

You can disable command extensions for a particular process by using /e:off. You can enable or disable extensions for all cmd command-line options on a computer or user session by setting the following REG_DWORD values:

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions\REG_DWORD

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions\REG_DWORD

Set the REG_DWORD value to either 0Г—1 (enabled) or 0Г—0 (disabled) in the registry by using Regedit.exe. User-specified settings take precedence over computer settings, and command-line options take precedence over registry settings.

Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer.

When you enable command extensions, the following commands are affected:

assoc

call

chdir (cd)

color

del (erase)

endlocal

for

ftype

goto

if

mkdir (md)

popd

prompt

pushd

set

setlocal

shift

start (also includes changes to external command processes)

If you enable delayed environment variable expansion, you can use the exclamation point character to substitute the value of an environment variable at run time.

File and directory name completion is not enabled by default. You can enable or disable file name completion for a particular process of the cmd command with /f:<on | off>. You can enable or disable file and directory name completion for all processes of the cmd command on a computer or for a user logon session by setting the following REG_DWORD values:

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\CompletionChar\REG_DWORD

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\PathCompletionChar\REG_DWORD

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar\REG_DWORD

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\PathCompletionChar\REG_DWORD

To set the REG_DWORD value, run Regedit.exe and use the hexadecimal value of a control character for a particular function (for example, 0Г—9 is TAB and 0Г—08 is BACKSPACE). User-specified settings take precedence over computer settings, and command-line options take precedence over registry settings.

Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer.

If you enable file and directory name completion by using /f:on, use CTRL+D for directory name completion and CTRL+F for file name completion. To disable a particular completion character in the registry, use the value for white space [0Г—20] because it is not a valid control character.

Pressing CTRL+D or CTRL+F, processes the file and directory name completion. These key combination functions append a wildcard character to string (if one is not present), builds a list of paths that match, and then displays the first matching path.

If none of the paths match, the file and directory name completion function beeps and does not change the display. To move through the list of matching paths, press CTRL+D or CTRL+F repeatedly. To move through the list backwards, press the SHIFT key and CTRL+D or CTRL+F simultaneously. To discard the saved list of matching paths and generate a new list, edit string and press CTRL+D or CTRL+F. If you switch between CTRL+D and CTRL+F, the saved list of matching paths is discarded and a new list is generated. The only difference between the key combinations CTRL+D and CTRL+F is that CTRL+D only matches directory names and CTRL+F matches both file and directory names. If you use file and directory name completion on any of the built-in directory commands (that is, CD, MD, or RD), directory completion is assumed.

File and directory name completion correctly processes file names that contain white space or special characters if you place quotation marks around the matching path.

You must use quotation marks around the following special characters: & [ ] | < >^ = ; ! ‘ + , `

If the information that you supply contains spaces, you must use quotation marks around the text (for example, «Computer Name»).

If you process file and directory name completion from within string, any part of the path to the right of the cursor is discarded (at the point in string where the completion was processed).

Оцените статью
Adblock
detector