![]() |
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-02 15:33 |
48,038 topics / 350,123 posts / today 1 new / 48,251 members |
| DOS批处理 & 脚本技术(批处理室) » How to terminate system processes |
| Printable Version 1,577 / 6 |
| Floor1 zdh | Posted 2006-11-06 22:38 |
| 初级用户 Posts 20 Credits 52 | |
|
I'm a new newbie, and I want to ask two questions:
1. How to use BAT to terminate system processes. Can it be batch processed when not knowing the process name (for example, only knowing that the process contains the letter Q)? 2. I wrote a BAT that calls a certain EXE, but if this EXE is not closed, the black box of the BAT will always be there. Can the BAT window be closed while calling the EXE? Thank you, great gods! |
|
| Floor2 namejm | Posted 2006-11-07 01:47 |
| 荣誉版主 Posts 1,737 Credits 5,226 From 成都 | |
|
You asked two irrelevant questions in this post. It is suggested to split them into two posts. First, it is conducive to future retrieval, second, it is convenient for layout management, third, it can also earn some points, he he.
1、You said you don't know the process name. According to the general understanding, you don't even know which process you want to terminate, so the bat is even more impossible to know what you want to do. It is estimated that you want to terminate a certain program, but you don't know what the process name corresponding to this program is, right? 2、Wait until you finish splitting, and then answer in the new post. |
|
| Floor3 zdh | Posted 2006-11-07 03:05 |
| 初级用户 Posts 20 Credits 52 | |
|
Yes, I'll split the post immediately!
|
|
| Floor4 zdh | Posted 2006-11-07 03:10 |
| 初级用户 Posts 20 Credits 52 | |
Originally posted by namejm at 2006-11-6 01:47 PM: I think you have a bit of a misunderstanding. I mean, knowing that the process name contains certain common letters (such as containing Q), can these processes be closed in batches? |
|
| Floor5 youxi01 | Posted 2006-11-07 05:14 |
| 高级用户 Posts 247 Credits 846 From 湖南==》广东 | |
|
For the XP system, you can simply use the following method:
@for /f %%i in ('tasklist /NH ^|find /I "NOTE"') do @taskkill /IM %%i /T Description: NOTE is the text included in the process you want to end. For the 2000 system, use WMI |
|
| Floor6 qujymr | Posted 2006-12-01 08:30 |
| 新手上路 Posts 3 Credits 6 | |
|
Q: How to close a process that cannot be closed with the Task Manager?
A1: Killing a process is very easy, any tool will do. For example, IceSword. The key is to find the startup method of this process, otherwise it will come out again after the next restart. By the way, teach you a tough trick. In fact, most processes can be killed with Windows built-in tools: c:\>ntsd -c q -p PID Only System, SMSS.EXE and CSRSS.EXE cannot be killed. The first two are purely kernel-mode, and the last one is the Win32 subsystem, and ntsd itself needs it. Ntsd has been a user-mode debugging tool built into the system since 2000. A process attached by a debugger will exit with the debugger, so it can be used to terminate the process from the command line. Ntsd automatically obtains debug permissions, so it can kill most processes. Ntsd will open a new debugging window. Originally, it cannot be controlled in the pure command line, but if it is just a simple command, such as exit (q), it can be passed from the command line with the -c parameter. Ntsd is also provided to software developers as usual. Only system developers use this command. For more information, see the help file attached in NTSD. Usage: Open a cmd.exe window and enter: ntsd -c q -p PID Change the last PID to the ID of the process you want to terminate. If you don't know the process ID, Task Manager -> Processes tab -> View -> Select Columns -> Check "PID (Process Identifier)", then you can see it. A2: Under XP, there are two more good things, tasklist and tskill. tasklist can list all processes and corresponding information. tskill can kill processes. The syntax is very simple: tskill program name!! |
|
| Floor7 vkill | Posted 2006-12-01 08:34 |
| 金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽 | |
|
1 It's possible, but it will definitely crash.
2 start *.exe |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |