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.

๐Ÿ’ 

๐Ÿ”ต Best-selling hard drives, USB flash drives & SSDs everyone's buying.

Fast, reliable, and on sale now. Thousands pick these weekly โ€” don't miss Amazon's lowest storage prices.

โšก Top 10 Bestsellers
๐Ÿ† 4.7โ˜…+ Reviews
๐Ÿ“ฆ Prime Shipping
๐Ÿ‘‰ See today's best-selling Data storage on Amazon.com HDD ยท USB Flash Drives ยท SSD ยท External Drives
๐Ÿ›’
โœ… Updated hourly โ€” Amazon real-time ranking ๐Ÿ”ฅ Limited stock deals ๐Ÿ”— Affiliate
โญ Click to see complete best-selling list โญ
Scroll to Top