国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 河源市| 通渭县| 仙桃市| 鄂伦春自治旗| 孟州市| 大冶市| 新建县| 景谷| 磐安县| 海林市| 郯城县| 巫山县| 新宾| 玛曲县| 英超| 岳普湖县| 庄浪县| 南木林县| 花垣县| 罗田县| 固阳县| 禄丰县| 保靖县| 京山县| 清水河县| 利津县| 井研县| 佛学| 城市| 泸定县| 衢州市| 历史| 安化县| 内丘县| 兰州市| 霍山县| 温宿县| 馆陶县| 吉安市| 安丘市| 天镇县|