5

In a command prompt window (terminal), how can I get my prompt to be just the current folder?

e.g.

prompt $p $g

gives:

C:\Users\Robin >

But I want it to just show:

Robin > 

UPDATE: As @Caius Jard said in the comments, the question identified doesn't duplicate this, as I don't want to simply remove the path, I want to have the current folder name included in the prompt.

e.g.

 Program Files >

or

 Users >

Hope that clarifies

  • Duplicate of https://superuser.com/questions/315354/how-do-i-hide-the-path-in-command-line-prompt-on-windows Answer is to use the following command 'prompt $g' – spikey_richie Oct 02 '17 at 10:13
  • 2
    Possible duplicate of [How do I hide the path in command line prompt on Windows?](https://superuser.com/questions/315354/how-do-i-hide-the-path-in-command-line-prompt-on-windows) – u1686_grawity Oct 02 '17 at 10:31
  • 3
    Not exactly: `prompt $g` will just show `>` as the prompt, not `name_of_current_folder>` as prompt - which is what he wants. i.e. he wants the folder he is in, without any of the path above it, and a > as his prompt – Caius Jard Oct 02 '17 at 10:34
  • PowerShell can apparently do this -- https://superuser.com/questions/446827/configure-the-windows-powershell-to-display-only-the-current-folder-name-in-the – Anaksunaman Oct 02 '17 at 10:52
  • Thanks @CaiusJard. You're absolutely right, thanks. I've clarified the question above. – ro͢binmckenzie Oct 02 '17 at 11:57
  • Thank @Anaksunaman, I've switched to PowerShell, and the question you linked to has done the job. Took a bit of fiddling (setting up profile, setting ExecutionPolicy (to Unrestricted, unfortunately, *gulp*), but it's working – ro͢binmckenzie Oct 02 '17 at 12:23
  • @robinmckenzie eek! Well, glad it's working, regardless. =P – Anaksunaman Oct 02 '17 at 12:27

0 Answers0