ERRORLEVEL command with colors?

Posted on

Question :

I created a script bat to tess some links, to using the command ping with errorlevel and it worked perfectly, but wanted that when I did not have communication, that is, did not dribble, it was of another color, red type. If I get communication, that is, if it drips, it turns green … does anyone know anything that can help me?


Answer :

For commands running on Linux Terminal, things seem to be a lot easier than in Windows Prompt.

This snippet removed from this site :

echo -e "e[31mHello Worlde[0m"

Make a Hello World appear in red.

For the Windows Prompt, I’ll leave SOEN’s answer because, at least for me, they are very complex commands .

I found the second one less confusing, but it leaves a temporary file behind, accepts it as the best answer.

Leave a Reply

Your email address will not be published. Required fields are marked *