时间:2021-03-22 09:10:53 | 栏目:DOS/BAT | 点击:次
实现代码一: 通过 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