![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Windows Vista™ Ultimate | KillAll NonEssential Programs 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 ![]() 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 - Sleep Shortcut Installer, Script by sidney1st ![]() Programs Screenshot: ![]() Cheers Steven Last edited by dmex; 08-09-2008 at 01:46 PM.. |
My System Specs![]() |
| | #2 (permalink) |
| Vista x64 Ultimate SP2, Windows 7 Ultimate x64 | re: KillAll NonEssential Programs Steven, Does the Sleep option install and uninstall like other install programs? If so, what does the KillAll option do? Sorry, running on fumes today. |
My System Specs![]() |
| | #3 (permalink) |
| Windows Vista™ Ultimate | re: KillAll NonEssential Programs Yeah the Sleep Setup creates a desktop and start-menu shortcut for calling Sidney1st`s Sleep Script and installs itself to C:\Program Files\VistaForum\SleepScript ... The KillAll Setup does exactly the same and also launches the KillAll Script found in C:\Program Files\VistaForum\KillAllScript, its designed to terminate all non-essential programs before benchmarking or playing games. I have tested both setup files for a variety of different scenarios and I believe they are ready for use and can be installed/uninstalled without issues and can be used from the desktop/start-menu ![]() Steven Last edited by dmex; 07-28-2008 at 12:10 AM.. |
My System Specs![]() |
| | #4 (permalink) |
| Vista Home Basic Service Pack 1 32bit | Re: KillAll NonEssential Programs Thanks for the script mate, just what I was lookin' for. But I'm havin a few problems.. I was never any good @ .vbs scripts. But when I run the command script from an elevated command prompt I get a BlueScreen. The script works like clockwork when I dbl-click on the .vbs file or run in from a normal command prompt. |
My System Specs![]() |
| | #5 (permalink) |
| Win7x64 | Re: KillAll NonEssential Programs Thanks for the script mate, just what I was lookin' for. But I'm havin a few problems.. I was never any good @ .vbs scripts. But when I run the command script from an elevated command prompt I get a BlueScreen. The script works like clockwork when I dbl-click on the .vbs file or run in from a normal command prompt. |
My System Specs![]() |
| | #6 (permalink) |
| Windows Vista™ Ultimate | Re: KillAll NonEssential Programs Thanks for the script mate, just what I was lookin' for. But I'm havin a few problems.. I was never any good @ .vbs scripts. But when I run the command script from an elevated command prompt I get a BlueScreen. The script works like clockwork when I dbl-click on the .vbs file or run in from a normal command prompt. Just add these three process's into the script whitelist and it will solve the BSOD you get on Vista when running the script elevated ![]() lsm.exe csrss.exe wininit.exe |
My System Specs![]() |
| | #7 (permalink) |
| Win7x64 | Re: KillAll NonEssential Programs ![]() |
My System Specs![]() |
| | #8 (permalink) |
| Vista Home Basic Service Pack 1 32bit | Re: KillAll NonEssential Programs |
My System Specs![]() |
| | #9 (permalink) |
| Vista Home Basic Service Pack 1 32bit | Re: KillAll NonEssential Programs * bump * Any help on this one please? Really like this script; can save one hell of a headache, and save a million n a half hours when workin' on slow corrupted PC's running 100 processes |
My System Specs![]() |
| | #10 (permalink) |
| Windows Vista™ Ultimate | Re: KillAll NonEssential Programs The script contains some debug lines to help diagnose issues like this one ![]() You will see a prompt naming each process before its terminated, Just note the name of the process that causes the bluescreen just after you click ok ![]() Where you see these three lines in the script: ' DEBUG INFO :: MsgBox "TaskKill: " & objProcess.Name ' DEBUG INFO :: MsgBox "TsKill: " & objProcess.Name & "(" & objProcess.ProcessID & ' DEBUG INFO :: MsgBox "Terminate: " & objProcess.Name Change it like so: ' DEBUG INFO :: MsgBox "TaskKill: " & objProcess.Name ' DEBUG INFO :: MsgBox "TsKill: " & objProcess.Name & "(" & objProcess.ProcessID & ' DEBUG INFO :: MsgBox "Terminate: " & objProcess.Name That will uncomment the lines and allow them to be executed ![]() Then when you run the script it will show a messagebox with the name of the process, once you click OK it will kill that process then show another messagebox with the next process, After you identify what process is casuing the problem just change the two debug lines back to prevent all the message box's from appearing when you rerun the script ![]() Let me know what process is causing the problem and I will update the script here |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Programs not appearing at Start/All Programs | General Discussion | |||
| Help! Vista Premium x64 suddenly not loading programs on startup and no programs run! | General Discussion | |||
| Uninstalling Programs not in Windows Features or Programs & Featur | Vista General | |||
| Adding new programs to Default Programs list | Vista General | |||
| uninstalling programs that are not listed in programs and features | Vista General | |||