Created
February 4, 2016 09:56
-
-
Save qbikez/997a6a669d9c34c0a09a to your computer and use it in GitHub Desktop.
using colors in cmd console. from: http://stackoverflow.com/questions/2048509/how-to-echo-with-different-colors-in-the-windows-command-line
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