Windows CMD, show the current folder name at prompt dynamically like Bash
- by guneysus
I am trying to modify my CMD, to show only current dir name dynamically
like:
Desktop $
When i switched the folder, it must be updated.
It is not required to be code in purely batch file, it may depend any external commands, cygwin bash, etc.
@echo off
set a=bash -c "pwd | sed 's,^\(.*/\)\?\([^/]*\),\2,'"
%a%
cmd
outputs
_test-et
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. Tüm haklari saklidir.
>>
But
>> prompt %a%
gives
bash -c "pwd | sed 's,^\(.*/\)\?\([^/]*\),\2,'"