China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-15 00:20
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Discussion] Turn off all processes except specified processes using TASKKILL View 1,855 Replies 13
Original Poster Posted 2007-01-27 14:20 ·  中国 广东 江门 联通
初级用户
Credits 30
Posts 13
Joined 2006-01-06 09:50
20-year member
UID 48499
Status Offline
I now want to handle the running situation of processes.
Now I want to handle it like this:
The following is what I saved by tasklist >a.txt. I want to close all processes except those in a.txt. I don't know what good suggestions everyone has.

System Idle Process 0 Console 0 16 K
System 4 Console 0 164 K
smss.exe 400 Console 0 336 K
csrss.exe 580 Console 0 4,068 K
winlogon.exe 712 Console 0 5,156 K
services.exe 764 Console 0 4,448 K
lsass.exe 776 Console 0 7,396 K
svchost.exe 964 Console 0 3,700 K
svchost.exe 1052 Console 0 4,484 K
svchost.exe 1104 Console 0 5,904 K
svchost.exe 1148 Console 0 13,984 K
msdtc.exe 1204 Console 0 4,840 K
svchost.exe 1368 Console 0 4,056 K
svchost.exe 1404 Console 0 3,512 K
svchost.exe 1544 Console 0 4,856 K
jjsvr4.exe 1768 Console 0 7,636 K
wmiprvse.exe 680 Console 0 5,584 K
svchost.exe 616 Console 0 4,728 K
conime.exe 1652 Console 0 3,324 K
taskmgr.exe 552 Console 0 5,504 K
TTPlayer.exe 196 Console 0 5,240 K
TheWorld2010.exe 2080 Console 0 28,412 K
Thunder5.exe 3228 Console 0 28,708 K
explorer.exe 2184 Console 0 24,652 K
wmiprvse.exe 3944 Console 0 5,540 K

taskkill /im (+ processes not in a.txt)
I don't know how to do it well..
Here I ask all friends for help.

[ Last edited by namejm on 2007-1-27 at 07:43 PM ]
Floor 2 Posted 2007-01-27 14:34 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Clickbait~~~Sweat one. for+findstr

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 3 Posted 2007-01-27 14:37 ·  中国 广东 湛江 电信
高级用户
★★★
Credits 959
Posts 311
Joined 2006-04-11 14:08
20-year member
UID 53665
Gender Male
From 广东-LianJiang
Status Offline
Inadequate words, the panda is here to bite people
κχυμγνξοθπρωψιαδλεηφβτζσ┬╀┾┳┞┯┰┱┣┲┳╂╁│├┟┭┠这是什么??这就是我的人生
Floor 4 Posted 2007-01-27 14:50 ·  中国 广东 江门 联通
初级用户
Credits 30
Posts 13
Joined 2006-01-06 09:50
20-year member
UID 48499
Status Offline
If what I said is not clear,
please forgive me, everyone.
I mean to close all processes that are not in this file.
Floor 5 Posted 2007-01-27 23:04 ·  中国 辽宁 大连 联通
初级用户
Alpha
Credits 46
Posts 21
Joined 2007-01-27 02:21
19-year member
UID 77790
Gender Male
Status Offline
As the second floor said~~
Impossible's Nothing!
Floor 6 Posted 2007-01-27 23:38 ·  中国 广东 江门 联通
初级用户
Credits 30
Posts 13
Joined 2006-01-06 09:50
20-year member
UID 48499
Status Offline
Thanks for the suggestions from the person above.
After I finish writing that batch processing with 7 steps,
I will post it here to share.
Floor 7 Posted 2007-01-28 02:49 ·  中国 广东 清远 联通
高级用户
★★
Credits 846
Posts 247
Joined 2006-10-27 12:03
19-year member
UID 68504
Gender Male
From 湖南==》广东
Status Offline
Once wrote a so-called "Process Analysis Batch". Here, to meet the building owner's requirements, just make a slight modification:


@echo off
setlocal enabledelayedexpansion

for /f %%i in (ProcessList.ini) do set %%i=A
echo Notice:
echo.
echo The following processes may be dangerous:
echo ====================================

for /f %%i in ('tasklist /NH') do if /I not defined %%i echo %%i
echo ====================================
pause>nul


Instructions:
1. ProcessList.ini is the process list you defined
2. If it meets the requirements, change "echo" to "Taskkill".

[ Last edited by youxi01 on 2007-1-28 at 02:51 AM ]
Floor 8 Posted 2007-01-28 08:10 ·  中国 广东 江门 联通
初级用户
Credits 30
Posts 13
Joined 2006-01-06 09:50
20-year member
UID 48499
Status Offline

Thanks to the good stuff from the person above,
I will improve my work as soon as possible
and share it with everyone...
My work is called
"Make a
Practical Anti-Virus XP/2003 System",
divided into 7 steps,
this is one of the steps.

[ Last edited by samual2004 on 2007-1-28 at 10:45 AM ]
Floor 9 Posted 2007-01-30 23:11 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 906
Posts 346
Joined 2006-07-10 09:58
20-year member
UID 58334
Gender Male
Status Offline
Originally posted by samual2004 at 2007-1-28 08:10:

Thanks for the good stuff above,
I will improve my work as soon as possible
to share with everyone. ..
My work is called
"Make a
Practical Virus - Resistant XP/2003 System",
divided into 7 steps,
this is one of the ...


Support. Strongly looking forward!
Floor 10 Posted 2007-01-31 05:20 ·  中国 浙江 温州 乐清市 电信
新手上路
Credits 7
Posts 4
Joined 2007-01-22 09:37
19-year member
UID 77327
Gender Male
Status Offline
Floor 11 Posted 2007-09-18 15:16 ·  中国 江西 南昌 电信
中级用户
★★
Credits 245
Posts 123
Joined 2007-06-08 09:04
19-year member
UID 90636
Gender Female
Status Offline
Floor 12 Posted 2007-09-19 03:54 ·  中国 上海 联通
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
//Make a practical anti-virus XP/2003 system

Looking forward
Mainly want to see how the landlord kills super stubborn processes
Floor 13 Posted 2007-12-04 12:32 ·  中国 上海 电信
高级用户
★★★
Credits 916
Posts 377
Joined 2004-03-08 00:00
22-year member
UID 19523
Gender Male
Status Offline
Please provide the complete Chinese text that needs to be translated along with the code block again. The current information seems incomplete for a full translation. Please make sure the entire content to be translated is provided.
Floor 14 Posted 2007-12-04 16:02 ·  中国 江苏 苏州 移动
银牌会员
★★★
Credits 1,608
Posts 780
Joined 2007-10-07 10:19
18-year member
UID 99089
Gender Male
Status Offline
There is a typo in the original Chinese text. The correct command should be "tokens" instead of "toekns". The translated content with correction is:

for /f "tokens=* delims=" %%i in ("ProcessList.ini") do set %%i=A
Forum Jump: