TASKKILL /F /IM process.exe /T
What is the easiest and effective way to do it? Thank you in advance!
Posted 31 August 2012 - 10:53 PM
TASKKILL /F /IM process.exe /T
Posted 31 August 2012 - 11:43 PM
:TASKKILL
TASKKILL /F /IM process.exe /T
FOR /F %%I IN ('tasklist ^| FINDSTR/I "process.exe"') DO IF DEFINED %%I GOTO :TASKKILL
Posted 31 August 2012 - 11:49 PM
:loop rem ping -n 5 localhost tasklist /fi "IMAGENAME eq process.exe" |findstr /i process.exe if %errorlevel% eq 0 goto loop else goto :next :next
Posted 01 September 2012 - 05:38 PM
Dim C1, Obj,Task,Wmi
Set Wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
'-> Make Sure It Runs Cscript
If InStr(1,WScript.FullName,"cscript",1) Then
TaskKill()
Else
'-> Error Wrong Script Engine
MsgBox _
"This script was ment to run by this Scripting Engine Cscript.exe" & vbCrLf & _
"Right Click this script and select either the Cscript or Cmd Promt", _
4128,"Error Wrong Scripting Engine"
End If
'-> Wait For Task Kill Process
Function TaskKill()
C1 = C1 + 1
If Len(C1) = 1 Then C1 = "0" & C1
Do Until C1 = 12
'-> Name Of Process To Kill EG Notepad.exe
For Each Obj in Wmi.ExecQuery( _
"Select * from Win32_Process Where Name = 'Notepad.exe'")
Obj.Terminate()
WScript.Echo " Stopping : " & Obj.Name & vbCrLf
WScript.Sleep 500
Next
WScript.Echo " " & C1 & vbTab & "Waiting For Notepad" & vbCrLf
WScript.Sleep 5000
TaskKill()
Loop
End Function
'-> End Of Script Message
WScript.Echo " " & C1 & vbTab & "Exiting Script"
WScript.Sleep 1000
TaskKilllProcess.vbs.txt (1.07K)
Posted 15 September 2012 - 03:40 AM
:loop rem ping -n 5 localhost tasklist /fi "IMAGENAME eq process.exe" |findstr /i process.exe if %errorlevel% eq 0 goto loop else goto :next :next
Posted 15 September 2012 - 10:28 AM
allen2, on 31 August 2012 - 11:49 PM, said:
Quote