allen2023 当前离线
列兵
:Get_ip2name setlocal for /f "tokens=3 delims= " %%a in ('ping -a -n 1 %1 ^|find /i "["')do (set "ip2name=%%a"&set "ip2name=!ip2name:.lan=!") REM echo.ip:%1 ip2name:!ip2name! if "%ip2name%"=="" (set Bcode=1)else set Bcode=0 endlocal&set %2=%ip2name%&exit/b %Bcode%复制代码
正在 Ping MM202104161934.lan [192.168.2.134] 具有 32 字节的数据: 来自 192.168.2.134 的回复: 字节=32 时间=2ms TTL=128 192.168.2.134 的 Ping 统计信息: 数据包: 已发送 = 1,已接收 = 1,丢失 = 0 (0% 丢失), 往返行程的估计时间(以毫秒为单位): 最短 = 2ms,最长 = 2ms,平均 = 2ms复制代码
TOP
arp -a | findstr /c:" 192.168.2.134 " 192.168.2.134 00-23-14-ec-ca-d5 动态复制代码
for /f "skip=3 tokens=1,3 delims= " %%i in ('arp -a') do (set ip=%%i&set ip=!ip:^ =!&echo %%i&call :first) :first for /f "tokens=1-3 delims= " %%i in ('arp -a ^| findstr /c:" !ip! "') do (echo %%j)复制代码
计算机名 pc1 唯一 pc1 冲突 pc2 唯一复制代码