From the Windows command line or MS-DOS, you can clear the screen and all commands using the CLS command.
Run a command and then clear the screen
If you want to run a command and then clear the screen, put an ampersand at the end of your command, then the cls command.
test&cls
In the example above, if the current directory contained a batch file called test.bat, it would run the batch file, and then clear screen.
You can also add the cls command in any batch file to clear screen.
If you are trying to hide any confidential information or previously entered commands from the command, the F7 (for doskey) can still show previously entered commands.
Related information
- See our cls command page for further information and related links.
- See our clear definition for further information and related links.
- MS-DOS and Windows command line help and support.