FOR /f "tokens=2 delims=:" %%i in ('ipconfig/all^|find/i "物理地址" ') do Set mac=%%~i
FOR /f "tokens=2-3 delims=" %%i in ('ipconfig/all^|find/i "IPv4 地址" ') do Set ip=%%~i
FOR /f "delims=" %%i in ('netsh i i show in^|find/i "本地连接" ') do Set idx=%%~i
netsh -c "i i" add neighbors %idx:~1,2% "%ip:~1,20%" "%mac:~1,20%"