I have this script and I can't manage to get multiple string colors. this is the script:
:Sentence 1
@echo off
setlocal enableextensions enabledelayedexpansion
set lines=1
set "line1=This Line in Blue, please" && set LineCount=26
for /f %%a in ('"prompt $H&for %%b in (1) do rem"') do set "BS=%%a"
for /L %%a in (1,1,%lines%) do set num=0&set "line=!line%%a!"&call :type1
pause>nul
goto :EOF
:type1
set /a LineCount-=1
if %LineCount% == 0 ping localhost /n 2 >nul && goto Sentence2
set "letter=!line:~%num%,1!"
set "delay=%random%%random%%random%%random%%random%%random%%random%"
set "delay=%delay:~-6%"
if not "%letter%"=="" set /p "=a%bs%%letter%" <nul
for /L %%b in (1,40,%delay%) do rem
if "%letter%"=="" echo.&goto :EOF
set /a num+=1
goto type1
:Sentence2
@echo off
setlocal enableextensions enabledelayedexpansion
echo.
set lines=1
set "line1=This Line in Red, please" && set LineCount=25
for /f %%a in ('"prompt $H&for %%b in (1) do rem"') do set "BS=%%a"
for /L %%a in (1,1,%lines%) do set num=0&set "line=!line%%a!"&call :type2
pause>nul
goto :EOF
:type2
set /a LineCount-=1
if %LineCount% == 0 ping localhost /n 2 >nul && goto end
set "letter=!line:~%num%,1!"
set "delay=%random%%random%%random%%random%%random%%random%%random%"
set "delay=%delay:~-6%"
if not "%letter%"=="" set /p "=a%bs%%letter%" <nul
for /L %%b in (1,40,%delay%) do rem
if "%letter%"=="" echo.&goto :EOF
set /a num+=1
goto type2
end
echo.
pause
exit
Now I would like to get these two string in a different color: -This Line in Blue, please -This Line in Red, please
I tried FINDSTR /L
and COLOR /n
but I can't manage to get it right..... I know that batch doesn't really support multiple colors in a single command window, but it's possible with external files.
Could anyone help me out?
~Czgb