Have you ever tried to achieve coloured output in cmd.exe on a modern windows OS? I recently tried to do this on Windows 7 and found it extremely difficult to achieve from a scripting environment. So, I decided to create a solution Under Linux, Unix and DOS a set of special commands called ANSI/VT100 escape sequences can be used to control the command terminal attributes. Under Windows these can be emulated using something like Cygwin. However, if you're restricted to cmd.exe your options are limited. Especially if you want a simple setup procedure for end users. The Windows API contains a function called SetConsoleTextAttribute which allows any application to change some basic console attributes including the colour of foreground text. My solution wraps this function in a tiny executable package so that it can be used by batch files and other scripting environments. The download, including source code, can be found here: col.zip (990 downloads) And here's some example usage..
@echo off col -praw col -graw set DEFATTRIBS=%ERRORLEVEL% col -fg=rgi @echo Some text in yellow.. col -add -bg=bi @echo Adding a blue background. col -sraw=%DEFATTRIBS% @echo And now restored to whatever your defaults were! @echo onLet me know if you find any problems, I'm happy to try out any suggestions you may have