1.

Solve : Color Result.txt?

Answer»

Hello,
It is possible to get colored result of different DOS Commands like:
Echo, Dir, Ping....

For example:I want to ping 2 or more IP's and i want to get the result colored RED if is not respondig GREEN if is responding.
I know that notepad cant dipslay color but WordPad or other TEXT editors can sow if possible would be helpfull.

Thank you!try to use ctext.exe.
put it to windows\system32 and start it in cmd to view HELP.


[attachment deleted by admin]I will try it.
Are there any other tools like that?
COULD be intresting to discover!!!
TY.I have used Crimson editor and Textpad which both also have the ability to display color attributes to code. As far as your output to be conditional RED for Ping Failing and Green Ping successful, it could be done aftre the command is executed after the output to the display is passed to an IF statement. If the string output equals the output match for successful then COLOR command to force the text output as GREEN on Black Background or if failing then COLOR command with HEX combination for RED and Black Background.

As far as having it all in RED or GREEN for the PING output text, it would only be possible if the ping condition can be tested prior to the execution of the command in which the COLOR command would be RED or GREEN and the ping command would then display in GREEN or RED...so you might need a routine like below

ping the IP or systemname, then test if live or not. CLS Clear screen then COLOR xx command where xx is the HEX for the GREEN or RED on Black or White Background, then run the ping command again to have it display in the correct color for the condition.

You will need an IF statement to test for the echo of the ping string output to be able to designate RED or GREEN and use COLOR xx command to change text color on execution.

Only other way I can thing of is to withhold the output of the ping command without it echoing to the display, test the condition which will set the proper color, then output the RESULTS of the ping in that color. More complicated and I am not sure if the output can be withheld for output after execution without displaying its operation when executed which is forced to display to the display by default.



Discussion

No Comment Found