Windows – Customizing command window prompt

command linepromptwindows

I am running a bunch of commands in a command prompt on a Windows server over a period of time and I would like to see when I last ran a command. I used the prompt command to customize the prompt.

prompt $t $p$g

to get a prompt that looks like

13:02:50.64 L:\>

I would like to use 12 hour time in the prompt and drop off the tenths/hundredths of a second, but it doesnt appear there is an option to do this. I would like for it to look like

1:02:50PM L:\>

Perhaps someone knows a way?


Using

prompt $T$H$H$H $p$g

gets me a prompt that looks like

15:35:11 L:\>

Which is closer, but it doesnt look like it will do 12 hour format.

Best Answer

For the PROMPT command, from this page, it says to use $T for 12-hour time. This DOES still have the tenths/hundredths of a second, but I don't think this can be removed.

Related Question