Clear the screen.


If CLS is redirected to file, console or executed through FOR /F it will print a line feed character (ASCII 10).


If the screen is successfully cleared %ERRORLEVEL% will be unchanged, typically this will be 0 but if a previous command set an errorlevel, that will be preserved (this is a bug).

If a bad switch is given %ERRORLEVEL% ➞ 1


Display a message and then immediately clear the screen:

Echo Hello
Echo You didnt see that

CLS is an internal command.

“ For every complex problem there is an answer that is clear, simple, and wrong” ~ H. L. Mencken

Related commands

ECHO - Display message on screen.
Equivalent PowerShell: Clear-Host - Clear the screen.

Copyright © 1999-2024
Some rights reserved