Sometimes you may need to view the CMD history on Windows 10/11. How to list the history of Command Prompt? If you are trying to figure it out, this post of MiniTool is what you need. It provides detailed steps to get Windows CMD history in Command Prompt and PowerShell.

Command Prompt (CMD) is a widely popular and practical Windows command-line tool that can be used to deal with various works, such as CMD rename file, CMD ping test, CMD list filesCMD copy filesCMD list drivesCMD check WiFi password, and more.

However, a great many users and even professionals are unclear about these commands. For example, some users want to check the Command Prompt history in Windows 10/11 but don’t know how to do that. So, here we provide a full guide to list the CMD history in Command Prompt and PowerShell.

Get-ADUser: How to Get AD User PowerShell in Windows 10/11
Get-ADUser: How to Get AD User PowerShell in Windows 10/11

What is Get-ADUser in PowerShell? How to get AD User PowerShell in Windows 10/11? This post explains these questions in detail and provides other useful tips.

Read More

How to View CMD History in Command Prompt

How to check Command Prompt history Windows 10/11 in Command Prompt? There are 2 methods. You can use the keyboard or the Doskey.

# 1. Check Windows CMD History Using the Keyboard

The first and simplest method is to use your keyboard with the Command Prompt. To do this work, follow the steps below:

Step 1. Press Win + R keys to open the Run dialog box, and then type cmd in it and hit Enter.

type cmd in the Run box

Step 2. In the Command Prompt window, press and hold the F7 key to view the history of Command Prompt. Then it will open the list of commands you currently typed in.

check CMD history using F7

Step 3. With the command history Windows opened, you can run the command again using the up or down arrow keys. Also, you can press the Esc key to exit the Command Prompt window without running any command.

Tips:

You can press Alt + F7 key to wipe the Windows Command Prompt history from the current session.

# 2. Check Windows CMD History Using the Doskey

The Doskey is another simple tool that can list the previously entered commands, edit command lines, and create macros. Here’s how to view Windows Command Prompt history using the Doskey.exe.

Step 1. Open the Command Prompt window again as we explained above.

Step 2. Type the following command and hit Enter. The the command lines you recently executed will appear in the Command Prompt window.

doskey /history

Step 3. If you want to select and run the command, you can use the Up or Down arrow key and hit Enter. In addition, you can press the Page Down key to reenter the last command from the current session history or Page Up key to reenter the first command.

check CMD history using Doskey

Note:

Windows will automatically clear the history of CMD logs and restart it for the new session once you restart your computer.

Step 4. If there are some useful commands that you may want to save for future use, you can run the following command to export the CMD history to a txt file. You can find the txt file in your WIndows Users folder.

doskey /HISTORY > history.txt

How to View CMD History in PowerShell

PowerShell can help you find the command history on Windows 10/11 as well. It’s very simple to view the PowerShell command history. Right click the Start menu from the bottom left screen and select Windows PowerShell. In the pop-up window, type the history command and hit Enter.

PowerShell check command history

In addition, you can press Win + R keys to open the Run box, and then copy and paste the following command in it and hit Enter. It will direct you to a txt file that stores the command history of all sessions in PowerShell.

%userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline

check the txt file of the CMD history

Gpupdate Force Command to Update Group Policy in CMD/PowerShell
Gpupdate Force Command to Update Group Policy in CMD/PowerShell

What is gpupdate force? How to force Group Policy update in Command Prompt and PowerShell? This post will explain the force Group Policy update in detail.

Read More

Further reading: If you enter some issues like file system corruption and low disk space on Windows 10/11, don’t worry. MiniTool Partition Wizard can help you fix them easily by checking file system errors, extending/resizing partitions, analyzing disk space, upgrading to a larger hard disk, etc.

  • Linkedin
  • Reddit