jeykey
Newbie | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору strComputer = "." strMACAddress = "00:00:00:00:00:00" Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colNetAdapters = objWMIService.ExecQuery _ ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE and MACAddress = " & """" & strMACAddress & """") strIPAddress = Array("000.000.000.000") strSubnetMask = Array("000.000.000.000") strGateway = Array("000.000.000.000") strGatewayMetric = Array(1) strDNS = Array("000.000.000.000", "000.000.000.000") For Each objNetAdapter in colNetAdapters errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask) errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric) errDNS = objNetAdapter.SetDNSServerSearchOrder(strDNS) If errEnable = 0 Then MsgBox "The IP address has been changed." Else MsgBox "The IP address could not be changed." End If Next | Всего записей: 21 | Зарегистр. 29-08-2006 | Отправлено: 12:20 26-05-2012 | Исправлено: jeykey, 12:21 26-05-2012 |
|