How to delete the command history in cmd.exe

Updated July 20, 2017

Whenever you run a command through the Run dialogue box -- or the Windows Live Search Box in Vista or Windows 7 -- Windows saves it in the Windows Registry. When you want to run this command again, you only need to type in a letter or two and Windows will give you the option of selecting the command from a drop-down list. If this list becomes too overpopulated -- and it will if you run numerous commands -- you may want to clear the history. This can be accomplished by typing a simple command into the Windows Command Prompt.

Open the Start menu and type "CMD" into the Windows Live Search box. Or, if you are using Windows XP, launch the "Run" dialogue box and type "CMD" into that instead.

Press "Enter" to bring up the Command Prompt window.

Type the following command into the Command Prompt:

reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU /va /f

Press the "Enter" key to execute the command. This will delete the registry value that contains all the stored command history from your computer.

Cite this Article A tool to create a citation to reference this article Cite this Article

About the Author

Joshua Benjamin began as a professional freelance writer in 2009. He has successfully published numerous articles spanning a broad range of topics. Benjamin's areas of expertise include auto repair, computer hardware and software, firearms operation and maintenance, and home repair and maintenance. He is currently pursuing a Bachelor of Business Administration from California State University, Fresno.