Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this batch file i wrote, and i wrote it to make specific words to be different colors, as a test.

But so far, i can't get any farther than this, I'm stuck, and I was wanting to use it to make other words in different colors, to make a color coding scheme. But can't figure out how. I've honestly spent weeks trying to figure this one out but am having no luck.

Here is my code:

MD Color
CD Color
echo Cool> "Text to Color"
echo Hello> "Test"
echo Test> "Helloo"
FINDSTR /A:0c /C:"Cool" /S "Text to Color"
FINDSTR /A:0b /C:"Hello" /S "Test"
FINDSTR /A:0a /C:"Test" /S "Helloo"
RD /S /Q Color

The name of the file is "Text to Color.bat" in a folder named "Color"


C:\Users\CST27\Dropbox\Color\Color>FINDSTR /A:0c /C:"Cool" /S "Text to Color"
Text to Color:Cool

C:\Users\CST27\Dropbox\Color\Color>FINDSTR /A:0b /C:"Hello" /S "Test"

C:\Users\CST27\Dropbox\Color\Color>FINDSTR /A:0a /C:"Test" /S "Helloo"


C:\Users\CST27\Dropbox\Color>RD /S /Q Color
Press any key to continue . . .

With "text to color" in red, "test" in blue, and "Helloo" in green.

And I was wanting to maybe try and make the words after those in a different color as well.

share|improve this question
up vote 2 down vote accepted

Use Windows PowerShell instead of cmd.exe

Write-Host -ForegroundColor Red -Object "Hello";
Write-Host -BackgroundColor Blue -Object "World!";
share|improve this answer
Now, can i make a batch file or some type of file that opens in windows powershell? – JustinD Nov 29 '12 at 13:24
PowerShell commands can be executed in a script, and vice versa. The script contents should be saved to a .ps1 file. There is lots of documentation about how to execute scripts. – Trevor Sullivan Nov 29 '12 at 14:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.