你调置一个ping固定次数就停止的参数如:
set @b='ping 192.168.0.150 -t -n 10 -l 4000>D:/ping'+@a+'.txt' --10次就停止
或者用强制终止命令
set @b='taskkill /TM ping.exe /F'