当前位置: 代码迷 >> vbScript >> 用VBScript批改本机IP地址
  详细解决方案

用VBScript批改本机IP地址

热度:531   发布时间:2013-02-02 12:27:16.0
用VBScript修改本机IP地址
Dim IP,Name
Ip=Inputbox ("请输入IP")
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
    ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strIPAddress = Array(IP)
strSubnetMask = Array("255.255.255.224")
For Each objNetAdapter in colNetAdapters
    errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
Next


  相关解决方案