最好用的ping小工具,保存以下代码至txt,更改后缀为bat即可使用
@echo off&setlocal EnableDelayedExpansion
::Time 2020-12-09
::Author 火陌
::File ping小工具.bat
title ping小工具
color 0E
:Loop
echo\
echo 输入 1 关闭当前窗口
echo.
set /p ip=请输入域名或IP:
set "ip=%ip:&=%"
set "ip=%ip:?=%"
cls
for /f "tokens=1* delims==" %%a in ("%ip%") do set "ip=%%a"
if %ip% EQU 1 goto End
for /f "tokens=1* delims=//" %%a in ("%ip%") do (
for /f "tokens=1* delims=/" %%a in ("%%b") do set "ip=%%a"
)
echo %ip%
ping %ip%
goto Loop
:End
rem pause
带https或http及路径进行ping
带路径及参数的域名进行ping
当然直接输入ip进行ping也是可行的【为了解决ping域名时需要手动删除http及后方路径参数而编写】