Is It Possible to Clear the History in the Windows Command Prompt?

By Akemi Iwaya on March 9th, 2017

If you use the Windows command prompt often throughout your work day, you may want or need to periodically clear the command history. Is it possible to do so while the command prompt is still open? Today’s SuperUser Q&A post has the answer to a curious reader’s question.

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

The Question

SuperUser reader Alexander B. wants to know if it is possible to clear the history in the Windows command prompt:

When using the Windows command prompt, a person can press the up arrow key to view and retrieve old commands. Is it possible to erase the command history, and if so, how would a person do it?

Is it possible to clear the history in the Windows command prompt?

The Answer

SuperUser contributor AFH has the answer for us:

There is a simple keyboard shortcut for doing so while the command prompt is still open, Alt+F7. Alternatively, the command history is cleared every time you exit and restart the command prompt.

If you want to explore further, you will find that there are very few questions about the command prompt that are not answered on the SS64 reference website.


Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

Akemi Iwaya is a devoted Mozilla Firefox user who enjoys working with multiple browsers and occasionally dabbling with Linux. She also loves reading fantasy and sci-fi stories as well as playing "old school" role-playing games. You can visit her on Twitter and .

  • Published 03/9/17
More Articles You Might Like

Enter Your Email Here to Get Access for Free:

Go check your email!