I wanted to change cmd prompt from ,,C:/users/____/foldername>" to ,,foldername $ ".. But windows does not provide an easy way to do it so. Had anyone found any solution? If they did, is there any simple way to apply it?
Asked
Active
Viewed 87 times
0
-
Window CMD prompt string has limited choice; see http://www.hanselman.com/blog/a-better-prompt-for-cmdexe-or-cool-prompt-environment-variables-and-a-nice-transparent-multiprompt – DrMoishe Pippik Oct 19 '21 at 21:59
-
1Does this answer your question? [Display only the current directory name (not the full path) in Windows CMD Prompt](https://superuser.com/questions/861828/display-only-the-current-directory-name-not-the-full-path-in-windows-cmd-promp) – Scott - Слава Україні Oct 20 '21 at 03:50
1 Answers
0
I'm not sure that it's possible to change this behavior of command prompt.
An alternative solution is to use a batch script like that :
@echo off
:loop
for %%I in (.) do set currentFolder=%%~nxI
set /P commandLine=%currentFolder%$
%commandLine%
goto loop
Save this code in a .bat file to have your custom cmd.
Warning : the behavior could be sometime different compare to the true CMD.
S. Brottes
- 1,077
- 5
- 15