Hola.
Para poder terminar un proceso en una red en otra máquina distinta a la tuya, supongo que tendrás que utilizar sockets (se podría tambien con un Exe ActiveX, imagino), comunicando dos aplicaciones: una que da la orden de cerrar determinada aplicación en una máquina y otra que corra en esa máquina y que realice la labor.
Si la aplicación 'finalizadora' es la misma que ha iniciado el proceso a finalizar,
Option Explicit
Private Const PROCESS_QUERY_INFORMATION = &H400
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 lProcId As Long
Private Sub Comenzar()
lProcId = OpenProcess(PROCESS_QUERY_INFORMATION, False, Shell("Ejecutable.Exe Argumentos", vbNormalFocus))
End Sub
debería haber guardado el ID de proceso para posteriormente finalizarlo.
Private Sub Finalizar()
Dim lRc as long, lExitC as long
lRc = TerminateProcess(lProcId, lExitC)
End Sub
También se podrían recuperar las tareas activas identificar la que interese y finalizarla.
Option Explicit
Private Type PROCESSENTRY32
dwSize As Long
cntUsage As Long
th32ProcessID As Long
th32DefaultHeapID As Long
th32ModuleID As Long
cntThreads As Long
th32ParentProcessID As Long
pcPriClassBase As Long
dwFlags As Long
szExeFile As String * 260
End Type
Private Declare Function CreateToolhelpSnapshot Lib "kernel32" Alias "CreateToolhelp32Snapshot" (ByVal lFlags As Long, ByVal lProcessID As Long) As Long
Private Declare Function ProcessFirst Lib "kernel32" Alias "Process32First" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function ProcessNext Lib "kernel32" Alias "Process32Next" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Sub CloseHandle Lib "kernel32" (ByVal hPass As Long)
Private sTareas() As String
Private Sub GetProcesos()
Dim lSnapShot As Long
lSnapShot = CreateToolhelpSnapshot(2&, 0&)
If lSnapShot <> 0 Then
Dim Proceso As PROCESSENTRY32
Proceso.dwSize = Len(Proceso)
Dim lRc As Long, lCta As Long
lRc = ProcessFirst(lSnapShot, Proceso)
Do While lRc
lCta = lCta + 1
If lCta > 1 Then
ReDim Preserve sTareas(2, lCta)
Else
ReDim sTareas(2, 1)
End If
sTareas(0, lCta - 1) = Proceso.th32ProcessID
sTareas(1, lCta - 1) = Left(Proceso.szExeFile, InStr(Proceso.szExeFile, Chr(0)) - 1)
lRc = ProcessNext(lSnapShot, Proceso)
Loop
CloseHandle lSnapShot
End If
End Sub
Son ideas, tú verás como te va. Suerte.
Abur