- @echo off
- title 互助互利,代码可用,扫码头像,感谢赞助;有什么问题,可加QQ956535081及时沟通
- set ip=192.168.100.66
- set 掩码=255.255.255.0
- set 网关=192.168.100.1
- set dns=192.168.100.1
- for /f "delims=" %%a in ('wmic nic where "Description like '%%Remote NDIS%%'" get NetConnectionID /value^|find "="') do set %%a
- echo;%NetConnectionID%
- if not defined NetConnectionID (goto end)
- netsh interface ip set address name="%NetConnectionID%" source=static address=%ip% mask=%掩码% gateway=%网关%
- netsh interface ip set dns name="%NetConnectionID%" source=static address=%dns% register=PRIMARY
- :end
- pause
复制代码
|