0

If the possible is following, could someone help me do it?

I want to customize the Windows 7 command prompt (cmd.exe) so that instead of it showing C:\Users\Blah> , it shows

[HH:MM] text@text ~ $

Essentially, I want to make it look like it's Arch Linux but it's not.

/halp

CC BY-SA 3.0
1

2 Answers 2

0

As foxidrive says in comment, the built in help documentation for PROMPT describes the available meta characters for the PROMPT command.

There is no direct way to get time as HH:MM. You will have to use backspaces to strip off the minutes and seconds. Also, hours less than 10 may have a leading space instead of a leading zero, depending on regional settings.

prompt [$T$H$H$H$H$H$H] text@text ~ $$ 
CC BY-SA 3.0
4
  • The regional settings allow the user to change the %time% format so it could be set to HH:MM and then use %time% in the prompt.
    – foxidrive
    Jan 16, 2014 at 5:58
  • @foxidrive - True, the regional setting should be reflected in the $T output, so I updated my answer a bit. But I don't think it is possible to get a dynamic time value in the prompt using %time% or !time! - you must use $T.
    – dbenham
    Jan 16, 2014 at 6:21
  • This partly helped, I have most of it working, but I still need a way to have a way to have the path without C drive showing. for e.g: [Blah] text@text Users/Username/Desktop ~ $ so there is no C:\, and the \'s have turned into /'s. If there is no way to do this in just CMD, could I somehow do this with a batch file? Jan 16, 2014 at 6:22
  • @HudsonSerge - I'm pretty sure you are limited to the dynamic values listed in the help, plus any string literals. There is no way to dynamically manipulate the prompt via batch or any other scripting language.
    – dbenham
    Jan 16, 2014 at 11:59
0

Try Clink which supports customizing the prompt with Lua scripts, as well as adding Bash-style line editing, completion, and history just like Arch Linux.

CC BY-SA 3.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.