that doesnt seem to work remotely
here is the code i am trying to use now, i get a cast error now
Function WMIKill(ByVal Server As String, ByVal sProcess As String)
Dim strMoniker, strQuery As String
Dim colProcesses As Management.ManagementObjectSearcher
Dim refProcess As Management.ManagementObject
colProcesses = New Management.ManagementObjectSearcher("SELECT * FROM
Win32_Process WHERE Handle = '" & sProcess & "'")
colProcesses.Scope = New Management.ManagementScope("\\" & Server &
"\root\cimv2")
If colProcesses.Get.Count = 0 Then
ListOutPut.Items.Add(sProcess & " - Not found on " & Server)
Else
'there are some matching process, so loop through and kill
For Each refProcess In colProcesses.Get
If refProcess.InvokeMethod("Terminate", refProcess("handle")) = 0 Then
ListOutPut.Items.Add("(PID " & refProcess("Handle") & ") " & _
refProcess("Name") & _
" Terminated on - " & Server)
Else
ListOutPut.Items.Add("Unable to terminate - " & _
refProcess("Name") & " on " & Server)
End If
Next
End If
End Function