BatchFile code
@echo off
set addr=192.168.1.100
:loop
setlocal enabledelayedexpansion
for /f "tokens=1,2* delims= " %%i in ('netsh int ip show ipaddr^|find /i "本地连接"') do s……
[/Quote]
用批处理来记录IP的变更情况怎样,:)
[code=BatchFile]@echo off
set addr=192.168.1.100
:loop
setlocal enabledelayedexpansion
for /f "tokens=1,2* delims= " %%i in ('netsh int ip show ipaddr^|find /i "本地连接"') do set temp=%%i
echo %addr% %temp%
if not "%addr%"=="%temp%" (
echo %date% %time% %addr% --^> %temp%>>c:\log.txt
set addr=%temp%
)
ping 127.1 -n 10 >nul 2>&1
goto :loop[/code]