how to stop running programs on windows 7 with bat

2019-09-09 20:24发布

Can any body tell me how to stop (few) selected running program/software using batch file (.bat) in windows 7 64bit?

My requirement is simple : I've set utorrent and few download manager program to run on windows startup. usually I need it in that way... but sometimes I need to stop all those download managers along with utorrent in order to gain internet browsing speed. Now I have to close all those programs manually one by one...!!! I want to make it easy.... if I can use some commands to stop those programmes in just 1 step, using a batch file, that would be great....!!!

3条回答
叛逆
2楼-- · 2019-09-09 20:47

Look at the Windows 7 cmd utililty called Taskkill. You may pass it the name of the .exe that you want to terminate.

http://forum.thewindowsclub.com/windows-tips-tutorials-articles/29463-kill-processes-using-command-prompt-windows-7-8-a.html

查看更多
何必那么认真
3楼-- · 2019-09-09 20:57

FIrst, get the process id with TASKLIST

tasklist /fi "imagename eq java.exe"

output :

Image Name          PID    Session Name  Session# Mem Usage Status
=================== ====== ============= ======== ============
Java.exe            1060   RDP-Tcp#8     0        81 408 Ko

the use TASKKILL <pid>

taskkill /pid 1060

or directly

taskkill /F /FI "IMAGENAME eq java.exe"

ref : Kill process from command line

查看更多
祖国的老花朵
4楼-- · 2019-09-09 21:08

You can create the list of tasks that have to be closed using a batch file as shown below. E.g.:

taskkill /im notepad++.exe
taskkill /im eclipse.exe
taskkill /im outlook.exe
taskkill /im chrome.exe
taskkill /im word.exe
taskkill /im winscp.exe
taskkill /im iexplore.exe
taskkill /im OUTLOOK.exe
taskkill /im WINWORD.exe
查看更多
登录 后发表回答