Command Prompt is a fantastic tool that helps you manage your Windows system, especially to diagnose and troubleshoot errors and operate your system more effectively.

However, if you need to enter many commands on this interface, the previous commands and their results may seem distracting. This can even prevent you from focusing on a certain command on the process due to the clutter.

The best practice while performing such operations is to regularly clear the prompt to remove any unnecessary data or history.

cls-clear-screen

How to Clear Screen on Command Prompt?

By default, Command Prompt only contains one quick way to clear the screen. However, you may also create additional methods to do so and make the process even quicker.

The method most people are familiar with would be the CLS command. This command is short for CLear Screen and has been around since MS-DOS.

Using the CLS command is very easy. However, there are even easier ways of clearing the screen on Command Prompt. The command line includes adoskeycommand, which you may use to create a macro.

doskey-macro-cls

A macro is a replacement for a full command or multiple commands. If you make a macro on the Command Prompt’s session, it will be valid for the full session.

Here’s how you may create and utilize the macro to clear the screen on CMD:

After that, you may type and enter “c”, or the macro you set, after running any number of commands to clear the screen.

notepad-cls

Creating CMD File and Including It on Path

Using the Doskey command can only create a substitute for the CLS command for one active Command Prompt session. However, you may create a permanent replacement by creating a.cmdfile and including the file in a system path location.

Here are the necessary steps for this process:

Now, you may entercor the substitute letter of your choice on Prompt and clear the screen anytime you want.

save-cmd-file

Using PowerShell’s Clear-Host Command

Environment-variables-1

path-system-variables

powershell-clear-host

new-autohotkey-script