Batch file 更改批处理文件中ping结果行的颜色

Batch file 更改批处理文件中ping结果行的颜色,batch-file,Batch File,我知道有不同的颜色回声声明,但我还没有让它为我工作。我想有一个不同颜色的ping结果行。有办法吗 这是我在网络上ping IP地址的代码。任何建议都会有帮助 @echo off COLOR 4f ECHO OFF set /P ip=Enter last 2 quadrants of your ip (PC Number) separated with a (.) : %=% PING -n 2 10.1.%ip% PING -n 2 10.2.%ip% PING -n 2 10.3.%ip%

我知道有不同的颜色回声声明,但我还没有让它为我工作。我想有一个不同颜色的ping结果行。有办法吗

这是我在网络上ping IP地址的代码。任何建议都会有帮助

@echo off
COLOR 4f
ECHO OFF
set /P ip=Enter last 2 quadrants of your ip (PC Number) separated with a (.) : %=%
PING -n 2 10.1.%ip%
PING -n 2 10.2.%ip%
PING -n 2 10.3.%ip%
PING -n 2 10.4.%ip%
PING -n 2 10.5.%ip%
PING -n 2 10.6.%ip%
PING -n 2 10.7.%ip%
PING -n 2 10.8.%ip%
ECHO All done pinging. Press any key to exit. 
PAUSE 

我相信你要找的东西是可以找到的。这个密码是杰布写的

至于在您的场景中使用它,我猜您可以通过管道传输
ping
命令,或者将输出重定向到文件,然后使用此代码读取文件并更改颜色