- 1 year ago
Get date/time of commands from history on windows (cmd/ps)
In Windows command prompt (cmd) or PowerShell (ps), you can use the doskey /history
command to display a list of previously executed commands, along with their command numbers.
To get the date and time that a specific command was executed, you can use the following steps:
Open a command prompt or PowerShell window.
Type
doskey /history
and press Enter. This will display a list of previously executed commands, along with their command numbers.Find the command that you want to get the date and time for, and note its command number.
Type
doskey /history:<command number>
and press Enter, replacing<command number>
with the actual command number that you noted in step 3.The date and time that the command was executed will be displayed along with the command itself.
Note that the date and time displayed by the doskey /history:<command number>
command may not be precise to the second, and may only display the date and time to the minute.