- @echo off
- for /f "skip=1 delims= " %%a in ('wmic computersystem get name') do (set ComputerName=%%a)
-
- echo %ComputerName:~2%
-
- netsh interface ip set address name="本地连接" source=static addr=192.168.1.%ComputerName:~2% mask=255.255.254.0 gateway=192.168.1.1 gwmetric=0
- rem netsh interface ip set dns name="本地连接" source=static addr=202.98.198.167
- rem netsh interface ip add dns name="本地连接" addr=202.98.192.67 index=2
-
- pause
复制代码
|