Salu2 y cualquier sugerencia sera bien recibida. Gracias
--
-------------------------------------
Conservas Ortiz, S.A.
Iñaki Deuna, 15
48700 Ondarroa
Tfn: (34) 94 613 4313
Vizcaya (Spain)
--------------------------------------
A ver, las soluciones "clásicas" son utilizar un DHCP, o bien utilizar
la utilidad netsh.
Si no utilizas el DHCP supongo que será por que ya lo tenéis montado de
alguna forma, así que te quedaría la segunda opción, busca por la ayuda de
Windows el comando "netsh" y por deja.com. Aquí tienes un hilillo para que
veas de que va.
Suerte, agur
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 objNetAdapter
Un saludo!
Rubén Vigón
Microsoft MVP Visual Basic
(Guía de buen uso del foro)
http://perso.wanadoo.es/rubenvigon/foro
--
-------------------------------------
Conservas Ortiz, S.A.
Iñaki Deuna, 15
48700 Ondarroa
Tfn: (34) 94 613 4313
Vizcaya (Spain)
--------------------------------------
"Rubén Vigón" <vi...@QUITAESTOwanadoo.es> escribió en el mensaje
news:uL8BHw3o...@TK2MSFTNGP10.phx.gbl...
Determining All Local IP Addresses for All Installed Adapters
http://www.mvps.org/vbnet/code/network/getadaptersinfo-localipaddresses.htm
O bien, siguiendo con el ejemplo anterior de WMI:
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery _
("SELECT IPAddress FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled=True")
For Each IPConfig In IPConfigSet
For i = LBound(IPConfig.IPAddress) To UBound(IPConfig.IPAddress)
MsgBox IPConfig.IPAddress(i)
Next i
Next IPConfig
--
-------------------------------------
Conservas Ortiz, S.A.
Iñaki Deuna, 15
48700 Ondarroa
Tfn: (34) 94 613 4313
Vizcaya (Spain)
--------------------------------------
"Alberto Miguel" <ami...@ortiz.es> escribió en el mensaje
news:%23wWxQo3...@TK2MSFTNGP09.phx.gbl...