脚本专栏 发布日期:2025/1/8 浏览次数:1
实现代码一: 通过 route print 实现
@echo off for /f "tokens=4" %%a in ('route print^|findstr 0.0.0.0.*0.0.0.0') do ( set IP=%%a ) echo %IP%
实现代码二:
@echo off for /f "tokens=15" %%i in ('ipconfig ^| find /i "ip address"') do (echo %%i) pause>nul