|
zxlxsqzy
初级用户
 
积分 126
发帖 47
注册 2007-7-2
状态 离线
|
『楼 主』:
如何用批处理结束两个名字相同的进程中的一个
使用 LLM 解释/回答一下
我们这里的系统为了限制下载,用了个关键字屏蔽的Explorer.exe的软件
但是如果用 taskkill /f /im Explorer.exe就会连桌面进程 explorer.exe一起结束掉
想请教一下有没有什么办法只结束掉关键字进程Explorer.exe而不结束掉桌面进程explorer.exe?
我不想每次都先用tasklist找Explorer.exe的PID值
The system here uses a software that shields keywords in Explorer.exe to restrict downloads. But if you use taskkill /f /im Explorer.exe, it will end the desktop process explorer.exe together. I want to ask if there is any way to only end the keyword process Explorer.exe without ending the desktop process explorer.exe? I don't want to first use tasklist to find the PID value of Explorer.exe each time.
|
|
2007-7-2 17:56 |
|
|
AlexZhang
系统支持
            
积分 995
发帖 427
注册 2007-2-8
状态 离线
|
|
2007-7-2 22:21 |
|
|
qinbuer
高级用户
    我思故我在
积分 512
发帖 228
注册 2007-1-21
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
PID是无法直接分辨两个EXPLORER的,它只是进程运行时系统随机为进程分配
的,并不代表专门的进程,所以单纯只看PID,你不会知道到底应该终止哪个
EXPLORER,但我们可以通过WMIC分析两个进程的路径判断,只要是非
C:\WINDOWS下的EXPLORER就终止该进程PID
Last edited by qinbuer on 2007-7-3 at 12:04 PM ]
PID cannot directly distinguish between two EXPLORERs. It is just randomly assigned by the system when the process runs and does not represent a specific process. So simply looking at the PID, you won't know which EXPLORER you should terminate. But we can analyze the paths of the two processes through WMIC. As long as it is an EXPLORER not under C:\WINDOWS, terminate the PID of that process.
Last edited by qinbuer on 2007-7-3 at 12:04 PM ]
|

我确实是只菜鸟,而且这里X人太多,所以我不敢装X。谁要再说我装X,我就XXOO他。 |
|
2007-7-2 22:53 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
先taskkill /f /im explorer.exe,再start %systemroot%\explorer.exe。
或者如楼上兄弟说的,查看程序的路径来判断。
First, taskkill /f /im explorer.exe, then start %systemroot%\explorer.exe. Or as the brother upstairs said, check the path of the program to judge.
|
|
2007-7-3 08:11 |
|
|
zxlxsqzy
初级用户
 
积分 126
发帖 47
注册 2007-7-2
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
我是在网吧上网的。
如果用taskkill /f /im Explorer.exe 那样就会连系统的桌面进程explorer.exe也一起结束掉了,再加载explorer会造成系统托盘的计费系统的图标看不到而无法结帐。
当然我也可能先用tasklist查出Explorer.exe进程的PID值(这里系统进程和关键字屏蔽进程的名字差别只在与系统进程全小写的,,关键字屏蔽的进程第一个字母是大写的,所以可以很清楚判断哪个才是所需要结束的),然后用taskkill /f /pid +PID值来结束
可是因为系统做了很多的限制,每次都要这样查我觉得很烦。
我想请问一下的是有没有可能先用tasklist列出进程信息之后,用find的功能查找出关键字进程后的进程PID值,然后用taskkill 结束进程时调用查找出的值呢?
I'm surfing in an internet cafe.
If I use taskkill /f /im Explorer.exe, it will end the system's desktop process explorer.exe together. Reloading explorer will cause the icon of the billing system in the system tray to be invisible and unable to check out.
Of course, I might first use tasklist to find the PID value of the Explorer.exe process (here, the difference between the system process and the keyword blocking process name is that the system process is all lowercase, and the first letter of the keyword blocking process is uppercase, so I can clearly judge which one is the one to end), and then use taskkill /f /pid +PID value to end it.
But because the system has made a lot of restrictions, I find it tedious to check like this every time.
I want to ask if it is possible to first use tasklist to list the process information, then use the find function to find the PID value of the keyword process, and then use taskkill to end the process by calling the found value?
|
|
2007-7-3 23:58 |
|
|
lovehack2006
初级用户
 
积分 135
发帖 64
注册 2006-12-20
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
我有一个更简单的问题,如果我发现有两个 explorer.exe 的话
就执行一个命令说,这个机子中毒了,应该怎么写呀???
LX大哥请你帮帮我!!
I have a simpler question. If I find there are two explorer.exe, then execute a command saying that this machine is infected with a virus. How should I write it???
Brother LX, please help me!!!
|
|
2008-1-22 19:18 |
|
|
lovehack2006
初级用户
 
积分 135
发帖 64
注册 2006-12-20
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
我想过用PID是否相等来判断这个机子是否有两个explorer.exe
假如有一个的话,那么肯定是相等的,如果有两个的话,肯定是不相等的。
但是判断相等要怎么做呀?
I thought about using whether the PIDs are equal to determine whether this machine has two explorer.exe. If there is one, then they must be equal; if there are two, they must be not equal. But how to judge equality?
|
|
2008-1-22 19:19 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
tasklist /FI "IMAGENAME eq explorer.exe"
系统是不区分大小写的。。。
所以会得到2个。。然后你findstr下(这个区别大小写)
然后自己再做你想做的。。。对了上面的可以得到PID哦
tasklist /FI "IMAGENAME eq explorer.exe"
The system is case-insensitive...
So you will get 2. Then you can do a findstr on it (this is case-sensitive)
Then do what you want to do by yourself... Oh, by the way, you can get the PID from the above
|
|
2008-1-22 19:31 |
|
|
terse
银牌会员
    
积分 2404
发帖 946
注册 2005-9-8
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
这样试试
@echo off
for /f "tokens=1,2" %%i in ('tasklist /nh /FO TABLE') do (
if "%%i" == "Explorer.exe" taskkill /FI "pid eq %%j"
)
pause
taskkill /FI "pid eq %%j" 可能要加上 /f
Last edited by terse on 2008-1-22 at 08:02 PM ]
Try this way
@echo off
for /f "tokens=1,2" %%i in ('tasklist /nh /FO TABLE') do (
if "%%i" == "Explorer.exe" taskkill /FI "pid eq %%j"
)
pause
taskkill /FI "pid eq %%j" may need to add /f
Last edited by terse on 2008-1-22 at 08:02 PM ]
|

简单!简单!再简单! |
|
2008-1-22 19:55 |
|
|
lovehack2006
初级用户
 
积分 135
发帖 64
注册 2006-12-20
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
大家有没有看到我的问题呢??
我的问题是,如果我发现有两个 explorer.exe 的话,就向服务器发一个消息
说,这台机子可能中毒了。要怎么做呢???我P是个大菜鸟呀。什么不会!!
Has everyone seen my question??
My question is, if I find there are two explorer.exe, then send a message to the server saying that this computer may be infected with a virus. How to do it??? I'm a big newbie. I don't know anything!!
|
|
2008-1-22 22:26 |
|
|
yichu
新手上路

积分 2
发帖 1
注册 2008-1-24
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
谢谢9楼的脚本,让我隐藏指定程序进程的脚本有进展
Thanks to the script from floor 9, my script for hiding the process of a specified program has made progress
|
|
2008-1-24 17:04 |
|