How can I print color text under "cmd.exe" in windows XP

I've tried putting ansi.sys into config.nt, but later discovered that this is not relevant to "cmd.exe" (and obviously, ansi escape sequences don't just work without something to handle them).

I've tried writing a driver to call int 10h, but this blows up on the int 10h call with the following error:-
    Unhandled exception ...: 0xC0000005: Access Violation.

I don't recall an INT21 interface for changing color. I can't find any hints in MSVC++ help, nor google.

I know cmd.exe can *do* color, since after dropping into NTVDM and doing color there, it returns and retains the color on the cmd.exe's screen (and the cmd.exe's output overwrites both the residual outputted text as well as the color attributes, so whatever output routine cmd.exe is using, it's programmed to *do* colour it seems; and of course you can set everything to colors other than black+white (see cmd.exe /?)... it's just not clear how to have colored output!)
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ChrisDrakeAuthor Commented:
Awesome!  I *can't* beleive how long I spent both in Google *and* MSDN trying to hunt this down... It was of course there all the time; but as with almost all Microsoft technologies, if you don't know the obscure words/phrases MS have dreamed up for the concept (in this case - it was "SetConsoleTextAttribute()" ), you've got no chance of hunting it down.

Anyways - I wrote me my own shiny new ANSI to SetConsoleTextAttribute() converting driver, and I'm happy-as now :-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.