Created
June 13, 2018 18:54
-
-
Save cuibonobo/67cbf5056e9a0a7f8bef2052fb8dc835 to your computer and use it in GitHub Desktop.
Windows CMD.exe customization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem Place this file wherever you want, then create a new `AutoRun` string in | |
rem `Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor` that points to its location | |
rem This will print the username in magenta | |
set userprompt=$E[35m%username%$E[0m | |
rem This will print the current directory in green | |
set pathprompt=$E[32m$p$E[0m | |
rem This will print a linefeed | |
set linefeed=$_ | |
rem Determine if the current prompt has admin to print `$` or `>` | |
fltmc >nul 2>&1 && ( | |
set promptchar=$E[36m$$$E[0m$s | |
) || ( | |
set promptchar=$E[36m$g$E[0m$s | |
) | |
rem Set new prompt | |
PROMPT %userprompt% in %pathprompt%%linefeed%%promptchar% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment