Try
' Agregar Referencia System.Management.dll
Dim RutaService As String = ""
Using wmiService As ManagementObject = New ManagementObject("Win32_Service.Name='" + NombreServicio + "'")
wmiService.Get()
RutaService = System.IO.Directory.GetParent(wmiService("PathName").ToString.Replace("""", "")).ToString
End Using
Process.Start(RutaService)
Catch ex As Exception
MessageBox.Show("La carpeta no existe", "", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
fuente
No hay comentarios.:
Publicar un comentario