How to clear screen in a Windows command line (MS-DOS)

Updated: 01/24/2018 by Computer Hope
clear screen with msdos

From the Windows command line or MS-DOS, you can clear the screen and all commands by using the CLS command.

Run a command and then clear the screen

If you want to run a command and then clear the screen, you can type any command or execute any batch file, and then an ampersand and the cls command, as shown below.

test&cls

In the above example, if the current directory contained a batch file called test.bat it would run the batch file, and then clear screen.

Note

You can also add the cls command in any batch file to clear screen.

Note

If you are trying to hide any confidential information or previously entered commands from the command the F7 key (for doskey) can still show previously entered commands.

Additional information