This script will kill all programs except the Bare Minimum required for XP or Vista, useful for killing all applications before benchmarking and all or any programs you need killed very quick quick
Just add And objProcess.Name <> "name.exe" _ for programs you want whitelisted from the kill
I have created these two Setup Files for the Tutorials section
Vista KillAll Setup
Vista Sleep Script - http://www.vistax64.com/tutorials/165412-sleep-shortcut.html Installer, Script by sidney1st
Programs Screenshot:
Cheers
Steven
Just add And objProcess.Name <> "name.exe" _ for programs you want whitelisted from the kill
Code:
On Error Resume Next
Dim WshShell, WshFs, objWMIService, colProcessList
Set WshShell = WScript.CreateObject("WScript.Shell")
Set WshFs = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject("winmgmts:root\cimv2")
Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process")
' Verify termination executables exist
Set CheckTask = WshFs.GetFile(WshFs.GetSpecialFolder(SystemFolder) & "\system32\taskkill.exe")
Set CheckTs = WshFs.GetFile(WshFs.GetSpecialFolder(SystemFolder) & "\system32\tskill.exe")
Response = MsgBox("Would you like to terminate all non-essential applications?", 36, "Killall")
If Response = "6" Then
For Each objProcess in colProcessList
If objProcess.Name <> "System Idle Process" _
And objProcess.Name <> "System" _
And objProcess.Name <> "services.exe" _
And objProcess.Name <> "winlogon.exe" _
And objProcess.Name <> "smss.exe" _
And objProcess.Name <> "csrss.exe" _
And objProcess.Name <> "lsass.exe" _
And objProcess.Name <> "alg.exe" _
And objProcess.Name <> "svchost.exe" _
And objProcess.Name <> "spoolsv.exe" _
And objProcess.Name <> "nvsvc32.exe" _
And objProcess.Name <> "wmiprvse.exe" _
And objProcess.Name <> "wuauclt.exe" _
And objProcess.Name <> "explorer.exe" _
And objProcess.Name <> "wscript.exe" _
And objProcess.Name <> "cmd.exe" _
And objProcess.Name <> "taskkill.exe" _
And objProcess.Name <> "tskill.exe" _
And objProcess.Name <> "taskmgr.exe" _
Then
If CheckTask <> "" Then
' DEBUG INFO :: MsgBox "TaskKill: " & objProcess.Name
WshShell.Run("taskkill /F /IM " & objProcess.Name & " /T")
End If
If CheckTs <> "" Then
' DEBUG INFO :: MsgBox "TsKill: " & objProcess.Name & "(" & objProcess.ProcessID & ")"
WshShell.Run("tskill " & objProcess.ProcessID & " /A")
End If
' DEBUG INFO :: MsgBox "Terminate: " & objProcess.Name
objProcess.Terminate
End If
Next
WshShell.Run("shutdown /a")
Else
MsgBox "Application Termination Error...", 48, "Killall"
End If
Vista KillAll Setup
Vista Sleep Script - http://www.vistax64.com/tutorials/165412-sleep-shortcut.html Installer, Script by sidney1st
Programs Screenshot:
Cheers
Steven
Attachments
Last edited: