I have the following code that is used to kill a process knowing the PID on my local machine. Would it be hard to change this code to kill processes on another machine, presuming they have administrative rights of course.
Thanks in advance!
TN
Code:
Option Compare Database
Option Explicit
Private Declare Function OpenProcess Lib "kernel32" (ByVal _
dwDesiredAccess As Long, ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32" _
(ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" _
(ByVal hObject As Long) As Long
Private Const PROCESS_TERMINATE As Long = &H1
Private Sub Command1_Click()
Dim ProcHandle As Long
ProcHandle = OpenProcess(PROCESS_TERMINATE, False, CLng(236))
TerminateProcess ProcHandle, 0
CloseHandle ProcHandle
End Sub
Thanks in advance!
TN