Batch Files

How do you get a batch file to emit text in multiple colors?


sort by: active | newest | oldest
orksecurity7 years ago
I don't know if it still works, but the command-line console *used* to support a bunch of ANSI escape sequences which could do things like setting its color, moving the cursor, and so on. https://secure.wikimedia.org/wikipedia/en/wiki/ANSI_escape_code
Boy, doesn't "escape code" sound ancient?
"Quick, Robin -- to the Bat-file!"
wanna to make a batch file with connect using different credential.
i have a folder on the server which i want to show the user , but dont wanna him to see any other stuff on the server just that folder, please help
I've made a short and simple (jokes) batch file to help you:

@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

It works like a charm, assuming you know the colour command...

If you don't, type "color /?" in at your command prompt.
And I made a function on it here.