Kill all applications.

Kevlar

New member
Local time
7:39 PM
Messages
48
Hello, I am in the process of making a batch file but it needs to be able to close all open applications. I know I can use the kill command but that only works for designated applications. What i need is for it to close all possible applications.


I'm sorry if that wasn't clear.:o

Any suggestions would be great :D

Thanks
 

My Computer

Computer Manufacturer/Model Number
Custom Built
OS
Windows 7 Ultimate RC Build 7100
CPU
AMD Anthlon 64X2 5600 2.80 GHz
Motherboard
ASUS M2N AM2 NVIDIA nForce 430 MCP ATX AMD
Memory
2x G.SKILL 2GB 240-Pin DDR2 800
Graphics Card(s)
GeForce GTS 250 Core Edition 1GB
Monitor(s) Displays
Sceptre 20"
Screen Resolution
1680 x 1050
Hard Drives
Western Digital Caviar Black 500gb 7200rpm
PSU
500w Rosewell
Case
Antec 300
Mouse
Microsoft Wireless Mouse 5000
Other Info
Its not the best, but hey, its sure is reliable.
Hello, I am in the process of making a batch file but it needs to be able to close all open applications. I know I can use the kill command but that only works for designated applications. What i need is for it to close all possible applications.


I'm sorry if that wasn't clear.:o

Any suggestions would be great :D

Thanks

Which command are you using (or trying to use) to kill applications? Because this is what I get at a command prompt when I type KILL

Code:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
C:\Users\Peter Dzomlija>kill
'kill' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Peter Dzomlija>
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Virtual Machine
OS
Windows 7 Professional 32-bit SP1
CPU
AMD A4/A6
Motherboard
Intel Corporation 440BX Desktop Reference Platform
Memory
3.00GB EDO
Graphics Card(s)
VMware SVGA 3D
Sound Card
High Definition Audio Device
Monitor(s) Displays
Generic Non-PnP Monitor on VMware SVGA 3D
Screen Resolution
1440x900
Hard Drives
1 x 60GB VMware Virtual SATA Hard Drive ATA Device
Antivirus
Kaspersky Total Security
i dont think its easy to do that as some application run more than 2 process and some under system (that is if you group them by user and system and local) such as some anti virus programs
 

My Computer

OS
windows 7 ultimate
you cant kill "all" processes and not have it kill windows processes as well. why would you need to kill unknown processes to run your script? what are you trying to do with your script?
 

My Computer

Computer Manufacturer/Model Number
Black_Box (homebuilt)
OS
windows 7 RTM x64
CPU
Phenom II 965 Quad Core 3.4Ghz
Motherboard
Asus M4A79T Deluxe
Memory
Mushkin Blackline 8GB (4x2gb)
Graphics Card(s)
XFX Radeon 5970 Black Edition
Sound Card
onboard
Monitor(s) Displays
Dell 2408WPF-main Dell E248WFP-secondary
Screen Resolution
1920x1200-main 1920x1200-secondary
Hard Drives
OCZ Vertex Limited Edition 100GB (OS)
x1 WD Black Edition 500GB drive (Storage)
PSU
XFX 850w Black Edition (Modular)
Case
Mountian Mods H2go
Cooling
CoolITSystems ECO A.L.C.
Keyboard
Logitech MX 5500 wireless keyboard
Mouse
Razor Copperhead
Internet Speed
16Mb down/2Mb up Wowway Cable Internet
Im sorry guys/girls, i meant the TASKKILL command.

i dont think its easy to do that as some application run more than 2 process and some under system (that is if you group them by user and system and local) such as some anti virus programs

Even if a program runs more than one process, shouldnt closing the program stop all processes having to do with that program?
 

My Computer

Computer Manufacturer/Model Number
Custom Built
OS
Windows 7 Ultimate RC Build 7100
CPU
AMD Anthlon 64X2 5600 2.80 GHz
Motherboard
ASUS M2N AM2 NVIDIA nForce 430 MCP ATX AMD
Memory
2x G.SKILL 2GB 240-Pin DDR2 800
Graphics Card(s)
GeForce GTS 250 Core Edition 1GB
Monitor(s) Displays
Sceptre 20"
Screen Resolution
1680 x 1050
Hard Drives
Western Digital Caviar Black 500gb 7200rpm
PSU
500w Rosewell
Case
Antec 300
Mouse
Microsoft Wireless Mouse 5000
Other Info
Its not the best, but hey, its sure is reliable.
you cant kill "all" processes and not have it kill windows processes as well. why would you need to kill unknown processes to run your script? what are you trying to do with your script?

In Task Manager, there is a "Application" tab and a "Processes" tab.
What Im looking for is something to close all applications, not process having nothing to do with those applications.
 

My Computer

Computer Manufacturer/Model Number
Custom Built
OS
Windows 7 Ultimate RC Build 7100
CPU
AMD Anthlon 64X2 5600 2.80 GHz
Motherboard
ASUS M2N AM2 NVIDIA nForce 430 MCP ATX AMD
Memory
2x G.SKILL 2GB 240-Pin DDR2 800
Graphics Card(s)
GeForce GTS 250 Core Edition 1GB
Monitor(s) Displays
Sceptre 20"
Screen Resolution
1680 x 1050
Hard Drives
Western Digital Caviar Black 500gb 7200rpm
PSU
500w Rosewell
Case
Antec 300
Mouse
Microsoft Wireless Mouse 5000
Other Info
Its not the best, but hey, its sure is reliable.
you cant kill "all" processes and not have it kill windows processes as well. why would you need to kill unknown processes to run your script? what are you trying to do with your script?

In Task Manager, there is a "Application" tab and a "Processes" tab.
What Im looking for is something to close all applications, not process having nothing to do with those applications.

I've been looking into it a bit more, and all I can come up with is the TASKKILL command, and though it allow wildcards, it can't kill all processes:

Code:
TASKKILL [/S system [/U username [/P [password]]]]
         { [/FI filter] [/PID processid | /IM imagename] } [/T] [/F]
Description:
    This tool is used to terminate tasks by process id (PID) or image name.
Parameter List:
    /S    system           Specifies the remote system to connect to.
    /U    [domain\]user    Specifies the user context under which the
                           command should execute.
    /P    [password]       Specifies the password for the given user
                           context. Prompts for input if omitted.
    /FI   filter           Applies a filter to select a set of tasks.
                           Allows "*" to be used. ex. imagename eq acme*
    /PID  processid        Specifies the PID of the process to be terminated.
                           Use TaskList to get the PID.
    /IM   imagename        Specifies the image name of the process
                           to be terminated. Wildcard '*' can be used
                           to specify all tasks or image names.
    /T                     Terminates the specified process and any
                           child processes which were started by it.
    /F                     Specifies to forcefully terminate the process(es).
    /?                     Displays this help message.
Filters:
    Filter Name   Valid Operators           Valid Value(s)
    -----------   ---------------           -------------------------
    STATUS        eq, ne                    RUNNING |
                                            NOT RESPONDING | UNKNOWN
    IMAGENAME     eq, ne                    Image name
    PID           eq, ne, gt, lt, ge, le    PID value
    SESSION       eq, ne, gt, lt, ge, le    Session number.
    CPUTIME       eq, ne, gt, lt, ge, le    CPU time in the format
                                            of hh:mm:ss.
                                            hh - hours,
                                            mm - minutes, ss - seconds
    MEMUSAGE      eq, ne, gt, lt, ge, le    Memory usage in KB
    USERNAME      eq, ne                    User name in [domain\]user
                                            format
    MODULES       eq, ne                    DLL name
    SERVICES      eq, ne                    Service name
    WINDOWTITLE   eq, ne                    Window title
    NOTE
    ----
    1) Wildcard '*' for /IM switch is accepted only when a filter is applied.
    2) Termination of remote processes will always be done forcefully (/F).
    3) "WINDOWTITLE" and "STATUS" filters are not considered when a remote
       machine is specified.
Examples:
    TASKKILL /IM notepad.exe
    TASKKILL /PID 1230 /PID 1241 /PID 1253 /T
    TASKKILL /F /IM cmd.exe /T
    TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne untitle*"
    TASKKILL /F /FI "USERNAME eq NT AUTHORITY\SYSTEM" /IM notepad.exe
    TASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM *
    TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*"
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Virtual Machine
OS
Windows 7 Professional 32-bit SP1
CPU
AMD A4/A6
Motherboard
Intel Corporation 440BX Desktop Reference Platform
Memory
3.00GB EDO
Graphics Card(s)
VMware SVGA 3D
Sound Card
High Definition Audio Device
Monitor(s) Displays
Generic Non-PnP Monitor on VMware SVGA 3D
Screen Resolution
1440x900
Hard Drives
1 x 60GB VMware Virtual SATA Hard Drive ATA Device
Antivirus
Kaspersky Total Security
Hi Kevlar,

This should be possible using a For /f command that checks tasklist and uses 'TASKKILL /F /IM program.exe /T' on the results.

Have a go at it and let me know if you get stuck and I'll try to put it together for you. Batching is my forte :D
 

My Computer

Computer Manufacturer/Model Number
Custom Hack job
OS
Windows 7 Ultimate 64 bit
CPU
Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz
Motherboard
GigaByte EP45-UD3
Memory
8 GB Kingston
Graphics Card(s)
Nvidia GeForce 9600GT
Sound Card
Soundblaster Audigy
Monitor(s) Displays
AOC x2 22"
Hard Drives
2 x Samsung 500GB (RAID)
2 x Samsung 2TB
1 x WD Green 2TB
1 x Seagate 1TB
1 x Samsung 500GB
PSU
Thermaltake QFan 750W
Case
CM Scout Gaming
Cooling
Coolermaster V10
Keyboard
Microsoft Wireless Keyboard 1000
Mouse
Microsoft Wireless Optical 2000
Internet Speed
320
Other Info
Winfast PVR2000CP
LG DVD-RAM DVD/RW/DL Super Multi
Linksys WMP300Nx2 Wireless Adapter
Thanks alot!! it works like a charm
 

My Computer

Computer Manufacturer/Model Number
Custom Built
OS
Windows 7 Ultimate RC Build 7100
CPU
AMD Anthlon 64X2 5600 2.80 GHz
Motherboard
ASUS M2N AM2 NVIDIA nForce 430 MCP ATX AMD
Memory
2x G.SKILL 2GB 240-Pin DDR2 800
Graphics Card(s)
GeForce GTS 250 Core Edition 1GB
Monitor(s) Displays
Sceptre 20"
Screen Resolution
1680 x 1050
Hard Drives
Western Digital Caviar Black 500gb 7200rpm
PSU
500w Rosewell
Case
Antec 300
Mouse
Microsoft Wireless Mouse 5000
Other Info
Its not the best, but hey, its sure is reliable.
for a list of the running applications, you can use powershell

Code:
Set Word = CreateObject("Word.Application")
Set Tasks = Word.Tasks
For Each Task in Tasks
If Task.Visible Then Wscript.Echo Task.Name 
Next 
Word.Quit

I'm still wondering what purpose this script serves?
 

My Computer

Computer Manufacturer/Model Number
Black_Box (homebuilt)
OS
windows 7 RTM x64
CPU
Phenom II 965 Quad Core 3.4Ghz
Motherboard
Asus M4A79T Deluxe
Memory
Mushkin Blackline 8GB (4x2gb)
Graphics Card(s)
XFX Radeon 5970 Black Edition
Sound Card
onboard
Monitor(s) Displays
Dell 2408WPF-main Dell E248WFP-secondary
Screen Resolution
1920x1200-main 1920x1200-secondary
Hard Drives
OCZ Vertex Limited Edition 100GB (OS)
x1 WD Black Edition 500GB drive (Storage)
PSU
XFX 850w Black Edition (Modular)
Case
Mountian Mods H2go
Cooling
CoolITSystems ECO A.L.C.
Keyboard
Logitech MX 5500 wireless keyboard
Mouse
Razor Copperhead
Internet Speed
16Mb down/2Mb up Wowway Cable Internet
Back
Top