@echo off
setlocal
setlocal enabledelayedexpansion
rem throw away everything except the IPv4 address line
for /f "usebackq tokens=*" %%a in (`ipconfig ^| findstr IPv4`) do (
rem we have for example "IPv4 Address. . . . . . . . . . . : 192.168.42.78"
rem split on ':' and get 2nd token
for /f delims^=^:^ tokens^=
获取本机ipv4的cmd代码
最新推荐文章于 2025-02-07 16:31:36 发布
