Visual Basic - reiniciar pc remota

Life is soft - evento anual de software empresarial
 
Vista:
sin imagen de perfil

reiniciar pc remota

Publicado por gon (55 intervenciones) el 30/08/2006 19:03:01
hola amigos, necesito un favor a ver si pueden
lo que tengo que hacer el reiniciar o apagar una pc de red local, por ej seleccionar una ip 192.168.1.xxx y que se reinicie, alguien tiene idea como hacerlo
desde ya muchas gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:reiniciar pc remota

Publicado por Ultra Putrefactus (14 intervenciones) el 05/09/2006 17:13:56
Para esto, puedes ocupar los servicios WMI de windows, Aqui va un ejemplo:

Private Function ShutDownPc() As Boolean
Dim StrComputer As String
Dim ObjWMIService As Object
Dim colOperatingSystems As Object
Dim objOperatingSystem As Object
On Error GoTo ElError
StrComputer ="Direccion IP o Host Name"
Set ObjWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}\\" & _
StrComputer & "\root\cimv2")

Set colOperatingSystems = ObjWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem In colOperatingSystems
' Si el parametro es 2 lo rebootea, si es 1 lo apaga y si es cero, hace log off
objOperatingSystem.Win32Shutdown (2)
Next
Set ObjWMIService = Nothing
Set colOperatingSystems = Nothing
Set objOperatingSystem = Nothing
ShutDownPc = True
Exit Function
ElError:
ShutDownPc = False
End Function
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:reiniciar pc remota

Publicado por vxvx (1 intervención) el 22/09/2006 17:24:53
si yo tngo idea...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar