BATCHWIN XP PRO
taskkill /f /im "proceso.exe"
WIN XP HOME
tskill "proceso.exe"
EN VISUAL BASICen un formulario, insertar un command buton
private sub command1_click()
KillProcess("proceso.exe")
end sub
En un Modulo
Declare Function KillProcess Lib "KillProcess" (ByVal FileName As String) As Long
Public Sub KillProcess(ByVal processName As String)
On Error GoTo ErrHandler
Dim oWMI
Dim ret
Dim sService
Dim oWMIServices
Dim oWMIService
Dim oServices
Dim oService
Dim servicename
Set oWMI = GetObject("winmgmts:")
Set oServices = oWMI.InstancesOf("win32_process")
For Each oService In oServices
servicename = LCase(Trim(CStr(oService.Name) & ""))
If InStr(1, servicename, LCase(processName), vbTextCompare) > 0 Then
ret = oService.Terminate
End If
Next
Set oServices = Nothing
Set oWMI = Nothing
ErrHandler:
Err.Clear
End Sub
LOGICAMENTE PUEDES editarlos y hacerlo un tanto mas "versatiles", saludos
47