→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎08-12-2008 08:23 PM
‎02-04-2009 12:31 AM
‎02-03-2009 10:39 PM
Private Sub ExecuteFile(ByVal comp As ListViewItem)
Dim wmi As ManagementClass
Dim wmi_in, wmi_out As ManagementBaseObject
Dim retValue As Integer
Try
wmi = New ManagementClass("\\" & comp.Text & "\root\cimv2:Win32_Process")
' get the parameters to the Create method
wmi_in = wmi.GetMethodParameters("Create")
' fill in the command line plus any command-line arguments
' NOTE: the command can NOT be on a network resource!
wmi_in("CommandLine") = """" & My.Settings.ClientPath & "\lsclient.exe"" " & My.Settings.LSServer
' do it!
wmi_out = wmi.InvokeMethod("Create", wmi_in, Nothin)
' get the return code. This not the return code of the
' application... it's a return code for the WMI method
retValue = Convert.ToInt32(wmi_out("returnValue"))
Select Case retValue
Case 0
' success!
CompFinishedList.Add(comp)
Case 2
Throw New ApplicationException("Access denied")
Case 3
Throw New ApplicationException("Insufficient privilege")
Case 8
Throw New ApplicationException("Unknown failure")
Case 9
Throw New ApplicationException("Path not found")
Case 21
Throw New ApplicationException("Invalid parameter")
Case Else
Throw New ApplicationException("Unknown return code " & retValue)
End Select
Catch ex As ApplicationException
If Not CompErrorList.Contains(comp) Then
CompErrorList.Add(comp)
End If
MsgBox(ex.Message)
End Try
End Sub
‎01-27-2009 09:54 PM
‎01-14-2009 04:11 PM
‎01-13-2009 11:53 PM
‎12-21-2008 08:35 PM
‎12-21-2008 08:31 PM
‎12-05-2008 10:52 PM
‎12-05-2008 10:43 PM
‎12-05-2008 10:38 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now