天天看點

用vb腳本改變使用者的ip.網關.dns

Dim IP

Ip=Inputbox("請輸入IP")

strSubnetMask=Array("255.255.255.0")

DefaultIPGateway=Array("192.168.2.253")

DNSServer=Array("61.139.2.69")

strComputer = "."  

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")  

Set colNetAdapters = objWMIService.ExecQuery _  

    ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

strIPAddress=Array(Ip)

For Each objNetAdapter in colNetAdapters

    errEnable=objNetAdapter.EnableStatic(strIPAddress, strSubnetMask,DefaultIPGateway,DNSServer) 

Next 

本文轉自 luoguo 51CTO部落格,原文連結:http://blog.51cto.com/luoguoling/1183897

上一篇: 腳本 2

繼續閱讀