![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-08 22:14 |
47,811 topics / 349,895 posts / today 0 new / 48,253 members |
| DOS批处理 & 脚本技术(批处理室) » How to end one of two processes with the same name using batch processing |
| Printable Version 1,647 / 10 |
| Floor1 zxlxsqzy | Posted 2007-07-02 17:56 |
| 初级用户 Posts 47 Credits 126 | |
|
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.
|
|
| Floor2 AlexZhang | Posted 2007-07-02 22:21 |
| 系统支持 Posts 435 Credits 1,013 | |
| Floor3 qinbuer | Posted 2007-07-02 22:53 |
| 高级用户 Posts 228 Credits 512 | |
|
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 ] |
|
| Floor4 lxmxn | Posted 2007-07-03 08:11 |
| 版主 Posts 4,938 Credits 11,386 | |
|
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.
|
|
| Floor5 zxlxsqzy | Posted 2007-07-03 23:58 |
| 初级用户 Posts 47 Credits 126 | |
|
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? |
|
| Floor6 lovehack2006 | Posted 2008-01-22 19:18 |
| 初级用户 Posts 64 Credits 135 | |
|
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!!! |
|
| Floor7 lovehack2006 | Posted 2008-01-22 19:19 |
| 初级用户 Posts 64 Credits 135 | |
|
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?
|
|
| Floor8 slore | Posted 2008-01-22 19:31 |
| 铂金会员 Posts 2,478 Credits 5,212 | |
|
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 |
|
| Floor9 terse | Posted 2008-01-22 19:55 |
| 银牌会员 Posts 946 Credits 2,404 | |
|
Try this way
taskkill /FI "pid eq %%j" may need to add /f [ Last edited by terse on 2008-1-22 at 08:02 PM ] |
|
| Floor10 lovehack2006 | Posted 2008-01-22 22:26 |
| 初级用户 Posts 64 Credits 135 | |
|
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!! |
|
| Floor11 yichu | Posted 2008-01-24 17:04 |
| 新手上路 Posts 1 Credits 2 | |
|
Thanks to the script from floor 9, my script for hiding the process of a specified program has made progress
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |