If you have been typing commands into Command Prompt and want a clean slate, this guide shows you how to clear Command Prompt history properly, not just wipe the visible text. Windows keeps two different things when you use the console: what is currently shown on screen, and the list of commands you can recall with the up arrow. Clearing one does not automatically clear the other, so this guide covers both, along with how PowerShell handles things differently if you use that instead.

What you’ll need

  • A Windows PC with access to Command Prompt (cmd.exe)
  • Administrator access if you plan to change console settings, though clearing history itself does not require it
  • A few minutes, since this is a quick task once you know which command does what

Clear the visible screen in Command Prompt

The most common request is simply to tidy up what is on screen. This does not touch your command history, but it is the fastest way to make the window look fresh.

  1. Open Command Prompt by searching for “cmd” in the Start menu and pressing Enter.
  2. Click inside the Command Prompt window to make sure it is active.
  3. Type cls and press Enter.
  4. The screen wipes clean and the cursor returns to the top left, ready for a new command.

It is worth understanding that cls only clears the display buffer, the text you can see and scroll back through. It does not erase the list of commands stored in memory for that session, which is what the up arrow key still recalls.

Clear Command Prompt history to Clear Console History on Windows Command Prompt

To actually clear Command Prompt history so the up arrow stops recalling previous commands, you need to reset the recall buffer that Windows maintains through a feature called doskey. This buffer holds the commands you have typed in the current session.

  1. With Command Prompt open, type doskey /history and press Enter to see the full list of commands stored in the current session’s buffer.
  2. To clear that buffer, type doskey /reinstall and press Enter.
  3. Press the up arrow key to confirm the history has been reset. It should no longer recall commands typed before you ran the reinstall command.
  4. If you want a completely fresh session with no trace of prior activity, close the Command Prompt window entirely and open a new one. Command Prompt does not save history to a file by default, so once the window closes, that session’s history is gone.

This behaviour is one of the more useful things to know about Command Prompt compared with other consoles: unless you have deliberately set up logging or scripting to record output, cmd.exe does not persist its history between sessions the way some other tools do.

If you use PowerShell instead

PowerShell handles history differently and it catches people out. Unlike Command Prompt, PowerShell can keep a persistent history file on disk (managed by the PSReadLine module), meaning your commands may still be recoverable even after closing the window. If you use PowerShell rather than cmd.exe, you will likely need to run a separate Clear-History command and also delete the saved history file to remove it completely. Keep this distinction in mind if privacy is the goal, since clearing one console type does not clear the other.

Tips and troubleshooting

  • Remember that cls and doskey /reinstall do two different jobs. Use cls for a tidy screen and doskey /reinstall to actually reset what the up arrow recalls.
  • Closing the Command Prompt window is the simplest way to guarantee no history remains, since cmd.exe does not write a history file to disk by default.
  • If you are troubleshooting a script or batch file and need to review past commands rather than delete them, use doskey /history first to check what has been run before clearing anything.
  • Some third-party terminal apps that host Command Prompt sessions, or console emulators, may add their own scrollback logging on top of Windows’ defaults. Check that app’s settings if history seems to persist even after following the steps above.

Frequently asked questions

Does cls clear command history in Command Prompt?

No. The cls command only clears what is visible on screen. Your previously typed commands remain in the recall buffer and are still accessible with the up arrow key until you run doskey /reinstall or close the window.

Does Windows save Command Prompt history permanently?

By default, no. Command Prompt keeps its command history only in memory for the current session. Once you close the window, that history is discarded automatically, unless you have set up custom logging.

How do I clear history in PowerShell as well?

PowerShell can store a persistent history file through PSReadLine. Run Clear-History inside PowerShell to clear the in-session list, and check your user profile folder for a saved history file if you need to remove records permanently.

Can I stop Command Prompt from remembering commands during a session?

There is no simple toggle to disable recall entirely, but running doskey /reinstall at any point resets the buffer, effectively giving you a clean history without closing the window.

Whether you are clearing a console after testing commands, working through a wait, remove this incorrect self-link