2041Views11Replies
Echo independent color
Hello i'm makin a super advanced bat file for my comp noob m8 and it looks really complcated so i was wondering is it possible to color certan lines
e.g if their was an error it be in red with the rest of the screen in green
I ALREADY know about 'color 0a' but that fills the whole screen. I need a small block or just a line to be different & stand out
@echo off &setlocal
:: Create a backspace character:
for /f "delims=#" %%a in ('"prompt #$H# &for %%b in (1) do rem"') do set "Bs=%%a"
:: Redirect a string of dot and backspaces without line break
<nul >"Hello World!.#" set /p "=.%Bs%%Bs%%Bs%%Bs%"
:: Process FINDSTR
findstr /p /a:F4 . "*.#"
:: We need a linebreak because there was no in the file.
echo(
pause
This is not my code, it is g-one's.
Select as Best AnswerUndo Best Answer
Here is my edited code:
@echo off
for /f "delims=#" %%a in ('"prompt #$H# &for %%b in (1) do rem"') do set "bs=%%a"
setlocal enabledelayedexpansion
color 0a
title Colour Changer
:start
cls
set /p text=Type the text you want to change colours here:
set /p colour=Type the colour code here:
"%text%.@" set /p "=.%bs%%bs%%bs%%bs%"
findstr /p /a:%colour% . "*.@"
del %text%.@
pause >nul
goto start
Have fun!
Select as Best AnswerUndo Best Answer
. Is this what you're talking about?
Select as Best AnswerUndo Best Answer
It looks like your talking about the prompt command. Unfortunately, it doesn't cover colours.
Select as Best AnswerUndo Best Answer
O... I forget to attach the file. But here it is...
Select as Best AnswerUndo Best Answer
wait how do i make it colored?
Select as Best AnswerUndo Best Answer
I don't think you can make the text smaller, you might have to find a different text printing command
Select as Best AnswerUndo Best Answer
Of my extensive collection of command line tools, I have this one tool...(attached) It makes large font but it can be colored differing colors. Note: I did not make this program... It was written some time ago... in german (I think?) So the help argument does no good unless you translate it.
Select as Best AnswerUndo Best Answer
should work (perhaps use an actual ESC char instead of \033...)
See http://en.wikipedia.org/wiki/ANSI_color
Select as Best AnswerUndo Best Answer
echo -e "\033[40m\033[1;31mLight Red \033[0m replace 1;31 with 1;30 through 1;38 for different colors.
Select as Best AnswerUndo Best Answer
Yes, there is! Unfortunately, I don't know how to do it - but a few of my friends do! I'll ask them on monday... ....err.... working on research monday, won't be on school.... tuesday is LISEF (long island science and engineering fair)..... so..... wednesday!
Select as Best AnswerUndo Best Answer