修改建议:
@echo off&Setlocal Enabledelayedexpansion
::开启变量延迟
set ip=这写你的A
::先设置好A
set /p ip=请输入你要ping的IP:
echo !ip!
::测试用,看ip值是A还是B
REM if /I "%ip%"=="" Exit
::把这句判断是否为空删掉,因为如果你不输入任何值,ip就是A,若输入了,会B会覆盖A,无需判断。
@echo off&chcp 437|graftabl>nul 936
echo Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=>tee.com
echo 0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6>>tee.com
echo @VyI?@xAp~sA`LZNxOq@Kt@FB?sUs`LbLB?tgj`{gjB~0x>>tee.com
color 1f
for /l %%a in (1 1 3) do echo,
set "ip=192.168.1.1"
set /p ip=请输入你要ping的IP,回车默认192.168.1.1:
ping -n 10 %ip%|tee.com >ping.txt
echo,
echo 处理完成,结果在ping.txt中!请按任意键关闭对话框!
del tee.com&pause>nul