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
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

















Embed a 3D viewer in your Instructable
Maker Faire 2013 Slide Show!
Fried Contest Launches 5/13, HQ Celebrates with Fried Day Friday
MEH! :D A Build Night at Montana Ethical Hackerspace!
Got contest ideas? Want to help HQ staff?
Large Instructables Robot head made out of driftwood, check it out!
Call for pre-made parts!
The Instructables Green Design Contest is starting on Earth Day!
My instructable made it into Popular Science!
Orbotix wants to see your hacks - you could win a Sphero!


Visit Our Store »
Go Pro Today »




:: 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.
@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!
should work (perhaps use an actual ESC char instead of \033...)
See http://en.wikipedia.org/wiki/ANSI_color