国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > VBScript > 正文

用vbs實(shí)現(xiàn)配置靜態(tài) IP 地址

2020-07-26 12:00:42
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
將計(jì)算機(jī)的 IP 地址設(shè)置為 192.168.1.141,并將 IP 網(wǎng)關(guān)設(shè)置為 192.168.1.100。
腳本代碼
復(fù)制代碼 代碼如下:

strComputer = "." 
Set objWMIService = GetObject("winmgmts://" & strComputer & "/root/cimv2") 
Set colNetAdapters = objWMIService.ExecQuery _ 
    ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE") 
strIPAddress = Array("192.168.1.141") 
strSubnetMask = Array("255.255.255.0") 
strGateway = Array("192.168.1.100") 
strGatewayMetric = Array(1) 
For Each objNetAdapter in colNetAdapters 
    errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask) 
    errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric) 
    If errEnable = 0 Then 
        WScript.Echo "The IP address has been changed." 
    Else 
        WScript.Echo "The IP address could not be changed." 
    End If 
Next 

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 建宁县| 宁蒗| 枞阳县| 常州市| 噶尔县| 韩城市| 岳池县| 布拖县| 中卫市| 庄浪县| 仙游县| 乌兰浩特市| 太原市| 谷城县| 本溪市| 南丹县| 饶阳县| 花垣县| 泾川县| 夏邑县| 岑溪市| 四川省| 镇平县| 莆田市| 岑巩县| 平舆县| 偏关县| 乌苏市| 天长市| 崇仁县| 光泽县| 策勒县| 出国| 浦北县| 安西县| 康马县| 北海市| 临江市| 蒙城县| 德令哈市| 乐至县|