I\'m working on a program which generates the day\'s weather for D&D games. I want the program to display a warning in red text when a storm is generated so the DM is aw
Script from here: How to have multiple colors in a Windows batch file? a little modified (simplyfied):
@echo off
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 next line in another color:
call :ColorText 0c "There is an Ashstorm!"
echo this was red.
call :ColorText 0a "you survived it."
goto :eof
:ColorText
echo off
echo %DEL% > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1
goto :eof
It was a link in the very first answer of "possible duplicate: How to change the text color of comments line in a batch file "