Created
February 4, 2016 09:56
-
-
Save qbikez/b3b93727f01c32cc638c to your computer and use it in GitHub Desktop.
using colors in cmd console
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 SETLOCAL EnableDelayedExpansion | |
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do ( | |
set "DEL=%%a" | |
) | |
echo say the name of the colors, don't read | |
call :ColorText 0a "blue" | |
call :ColorText 0C "green" | |
call :ColorText 0b "red" | |
echo( | |
call :ColorText 19 "yellow" | |
call :ColorText 2F "black" | |
call :ColorText 4e "white" | |
goto :eof | |
:ColorText | |
echo off | |
<nul set /p ".=%DEL%" > "%~2" | |
findstr /v /a:%1 /R "^$" "%~2" nul | |
del "%~2" > nul 2>&1 | |
goto :eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment