July 20, 2009
Close Multiple Programs By One Click
It's difficult and often discouraging to have to open Task Manager and kill the processes by hand. It's very useful to be able to close applications from the command line, and even more useful to keep a batch file for it.
We have already learned how to open multiple file by using a batch. The process
Steps:
1. Open Notepad. Copy and paste the following into notepad:
@echo off
cls
TASKKILL /F /IM notepad.exe /IM mspaint.exe /IM calc.exe /IM excel.exe
pause
• This example kills every single occurrence of notepad.exe.
2. The syntax is somewhat simple /F stands for force, /IM kills by the process name, and taskkill supports * wildcards.
3. echo off, cls, and pause are just to make the batch script neater.
4. Go to File, and Save As.
5. Where it says "Save as type:", select All Files, and at File Name, type "myUtilityKiller.bat".
• The name doesn't matter, only the .bat matters.
6. Now double-click the .bat file, and all occurrences of notepad.exe, mspaint.exe, calc.exe, excel.exe/ whatever you have added will disappear.
Tips:
• You can add "pause" onto a new line so that you can see the output.
• You can also use wildcards to specify process to kill such as :
TASKKILL /FI "IMAGENAME eq n*"
This will close all processes beginning with n.
• To Kill process running on different system use the following syntax
TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*"
Such as:
TASKKILL /S 192.168.0.14 /U administrator /P xyz /FI "IMAGENAME eq note*"
This will terminate all process matching the wildcard on system 192.168.0.14 [IP address of the system]
Warnings
• It closes the process, and closing the wrong process may cause system instability.
0 Responses to “Close Multiple Programs By One Click”
Post a Comment