取得IP

Note:不同的OS,需更改IPv4此字串

@ECHO OFF
for /f "tokens=1-2 delims=:" %%a in ('ipconfig^|find "IPv4"') do set ip=%%b
SET IP=%IP:~1%
ECHO %IP%
TIMEOUT 5


command - Batch: get IP address - Stack Overflow