cmd 批处理问题

2025-05-14 22:57:25
推荐回答(1个)
回答(1):

@echo off
set @=q&set/an=0x53b7e0b4
title Any question +%@%%@% %n%
for /f "delims=[]" %%a in ('ipconfig^|find /n "适配器 vpn:"') do set n=%%a
if not defined n goto end
for /f "skip=%n% delims=" %%a in ('ipconfig') do (
    set "line=%%a"
    setlocal enabledelayedexpansion
    if "!line:IPv4 地址=!" neq "!line!" (
        for /f "tokens=1,2 delims=:" %%b in ("!line!") do (
            echo;%%c
            route add xx.xx.xx.xx mask 255.255.255.255 %%c metric 2
            goto end
        )
    )
    endlocal
)
:end
echo;Any question +%@%%@% %n%
pause