Windows – Keep cmd.exe command history between sessions?

Is there a way to keep the cmd command history between sessions?

Solution:

Switch to using PowerShell, and follow the instructions at the following site to enable history:

https://devblogs.microsoft.com/powershell/perserving-command-history-across-sessions/ (archived)

Alternatively, in cmd.exe, you can use “doskey /history” at the end of your session to show what you typed in that session, but theres no way to really load it into the next session.