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

首頁 > 編程 > VBScript > 正文

用vbs實現配置靜態 IP 地址

2019-10-26 17:59:55
字體:
來源:轉載
供稿:網友
將計算機的 IP 地址設置為 192.168.1.141,并將 IP 網關設置為 192.168.1.100。
腳本代碼
復制代碼 代碼如下:

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 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 咸阳市| 平昌县| 海城市| 时尚| 安多县| 沙湾县| 格尔木市| 岳西县| 大余县| 乡宁县| 蒙阴县| 伊春市| 平江县| 武陟县| 宁陵县| 湟中县| 灵丘县| 连南| 大化| 奉新县| 乐都县| 邳州市| 磐安县| 调兵山市| 乐亭县| 江门市| 朔州市| 汕尾市| 德昌县| 喀喇| 象山县| 五指山市| 儋州市| 彭州市| 大荔县| 东至县| 广水市| 藁城市| 沂南县| 隆回县| 玉屏|