达生集团,太原工业学院教务处,家长网
修改ip cmd /c netsh interface ip set address name=" 本地连接" source=static addr=211.82.56.253 mask=255.255.255.0 gateway=211.82.56.1 gwmetric=1
修改dns cmd /c netsh interface ip set dns name="本地连接" source=static addr=202.99.192.66
配置或更新ip地址: wmic nicconfig where index=0 call enablestatic("192.168.1.5"), ("255.255.255.0") ;index=0说明是配置网络接口1。
配置网关(默认路由): wmic nicconfig where index=0 call setgateways("192.168.1.1"),(1)
vbs
const t_gateway = "211.82.56.1" '网关
const t_newdns1 = "202.99.192.66" 'dns1
const t_newdns2 = "60.221.248.43" 'dns2
strwinmgmt="winmgmts:{impersonationlevel=impersonate}"
set nics = getobject( strwinmgmt ).instancesof("win32_networkadapterconfiguration")
for each nic in nics
if nic.ipenabled then
nic.setdnsserversearchorder array(t_newdns1,t_newdns2)
nic.setgateways array(t_gateway)
end if
next
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
-
用vbs实现文本循环读取
因为测试中需要读取一批url数据进行浏览,其实使用qtp本身的table能实现多种读取方式,但是因为需要tabel是使用excel保存的,在没有...
[阅读全文]
-
-
-
-
-
-
-
网友评论