Code: Select all
echo.
CALL :ColorText 0B "color"
set /p ".= " <nul
CALL :ColorText 0C "this"
set /p ".= " <nul
CALL :ColorText 01 "line" end
set /p ".= " <nul
echo.
echo.
pause
exit
:ColorText [%1 = Color] [%2 = Text]
set /p ".=." > "%~2" <nul
findstr /v /a:%1 /R "^$" "%~2" nul 2>nul
set /p ".={BS}{BS}" <nul
if "%3" == "end" set /p ".= " <nul
del "%~2" >nul 2>nul
exit /b
This code I am using result in displaying the text:
colorthisline:.
I want to get rid of the ":" and "." characters that appear in the output.
When I add another text to the code to color..
Code: Select all
CALL :ColorText 0B "color"
set /p ".= " <nul
CALL :ColorText 0C "this"
set /p ".= " <nul
CALL :ColorText 0E "first"
set /p ".= " <nul
CALL :ColorText 01 "line" end
set /p ".= " <nul
Which is the text "first". The output will be:
colorthisfirstline:.
I want to have the output as:
colorthisfirstline
So without the ":" and the "." How can I make this possible?
Thanks