中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-09 22:45
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 谁能为我代码简化一下 查看 830 回复 8
楼 主 谁能为我代码简化一下 发表于 2007-09-07 15:38 ·  中国 江苏 宿迁 电信
初级用户
★★
Batchs上議院參議長
积分 199
发帖 105
注册 2007-06-05 12:00
19年会员
UID 90300
性别 男
来自 江苏
状态 离线
:loop
:: 此段是本人学习 c 语法中 if嵌套式复合语句后添加的,增强了脚本的智能性
cls
echo process正在关闭非系统必要进程,请稍候...

"%process%" > "%temp%\processlist.txt"

type "%temp%"\processlist.txt|"%find%" /i "explorer.exe" >NUl
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "notepad.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "regedit.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "conime.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "internat.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "ctfmon.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "mspaint.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "WinRAR.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "mstask.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "mstask" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "ddhelp.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "kernel32.dll" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "kernel32" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "mmc" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "alg.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "regsvc.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "inetinfo.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "snmp.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "mdm.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "msgsrv.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "spool32.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "spool32" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "spoolsv.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "stisvc.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "taskmgr.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "ttmplatform.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "myie.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "myie" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "realsched.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "wdfmgr.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "wuauserv.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "vb6.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "taskmon.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "iexplore.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "editplus.exe" >NUL
if errorlevel==1 (

type "%temp%"\processlist.txt|"%find%" /i "emeditor.exe" >NUL
if errorlevel==1 (

echo.
echo 进程终止完毕!
goto :continue
)
"%process%" -k emeditor.exe
goto :loop
)

"%process%" -k editplus.exe
goto :loop
)

"%process%" -k iexplore.exe
goto :loop
)

"%process%" -k taskmon.exe
goto :loop
)

"%process%" -k vb6.exe
goto :loop
)

"%process%" -k wuauserv.exe
goto :loop
)

"%process%" -k wdfmgr.exe
goto :loop
)

"%process%" -k realsched.exe
goto :loop
)

"%process%" -k myie
goto :loop
)

"%process%" -k myie.exe
goto :loop
)

"%process%" -k ttmplatform.exe
goto :loop
)


"%process%" -k taskmgr.exe
goto :loop
)

"%process%" -k stisvc.exe
goto :loop
)

"%process%" -k spoolsv.exe
goto :loop
)

"%process%" -k spool32
goto :loop
)


"%process%" -k spool32.exe
goto :loop
)

"%process%" -k msgsrv.exe
goto :loop
)

"%process%" -k mdm.exe
goto :loop
)

"%process%" -k snmp.exe
goto :loop
)

"%process%" -k inetinfo.exe
goto :loop
)

"%process%" -k regsvc.exe
goto :loop
)

"%process%" -k alg.exe
goto :loop
)

"%process%" -k mmc
goto :loop
)

"%process%" -k kernel32
goto :loop
)

"%process%" -k kernel32.dll
goto :loop
)

"%process%" -k ddhelp.exe
goto :loop
)

"%process%" -k mstask
goto :loop
)

"%process%" -k mstask.exe
goto :loop
)

"%process%" -k WinRAR.exe
goto :loop
)

"%process%" -k mspaint.exe
goto :loop
)

"%process%" -k ctfmon.exe
goto :loop
)

"%process%" -k internat.exe
goto :loop
)

"%process%" -k conime.exe
goto :loop
)

"%process%" -k regedit.exe
goto :loop
)

"%process%" -k notepad.exe
goto :loop
)

"%process%" -k explorer.exe
goto :loop

:continue
if exist "%temp%\processlist.txt" del /q "%temp%\processlist.txt" >nul 2>nul
echo 下一步即将脚本控制中心 &pause:lol:

[ Last edited by koala on 2007-9-7 at 03:39 PM ]
『生如夏花之绚烂
死若秋叶之静美』 dos做到了
2 发表于 2007-09-07 16:16 ·  中国 天津 电信
银牌会员
★★★
积分 1,928
发帖 931
注册 2007-01-06 11:46
19年会员
UID 75624
性别 男
状态 离线
妈呀,忒强了!!!!
3 发表于 2007-09-09 15:23 ·  中国 云南 昆明 五华区 电信
初级用户
积分 26
发帖 13
注册 2007-08-12 15:38
18年会员
UID 95009
性别 男
状态 离线
根本看不懂
4 发表于 2007-09-15 19:48 ·  中国 广东 江门 新会区 电信
初级用户
积分 30
发帖 15
注册 2007-09-05 21:43
18年会员
UID 96658
性别 男
状态 离线
用函数嵌套调用的方式来简化吧
5 发表于 2007-09-17 20:36 ·  中国 陕西 渭南 电信
初级用户
★★
积分 186
发帖 92
注册 2007-03-27 08:20
19年会员
UID 83047
性别 男
状态 离线
关闭非系统进程也用不着这么复杂啊
6 发表于 2007-09-18 10:51 ·  中国 陕西 渭南 电信
初级用户
★★
积分 186
发帖 92
注册 2007-03-27 08:20
19年会员
UID 83047
性别 男
状态 离线
信不信,用一句批处理就能结束不在文本中的进程名
7 发表于 2007-09-18 14:36 ·  中国 江西 南昌 电信
中级用户
★★
积分 245
发帖 123
注册 2007-06-08 09:04
19年会员
UID 90636
性别 女
状态 离线
妈的 你也太强了吧 自卑中·····
8 发表于 2007-10-04 00:21 ·  中国 湖北 潜江 电信
高级用户
★★★
积分 894
发帖 411
注册 2007-02-17 12:15
19年会员
UID 79697
性别 男
状态 离线
相信六楼, 不过楼主的精神可佳.
@set c= 不知则觉多,知则觉少,越知越多,便觉越来越少. --- 知多少.
@for,/l,%%i,in,(1,1,55)do,@call,set/p=%%c:~%%i,1%%<nul&ping/n 1 127.1>nul


9 发表于 2008-09-24 20:33 ·  中国 江苏 南京 电信
初级用户
★★
Batchs上議院參議長
积分 199
发帖 105
注册 2007-06-05 12:00
19年会员
UID 90300
性别 男
来自 江苏
状态 离线
现在明白了 可以用 佛如语句简化额
『生如夏花之绚烂
死若秋叶之静美』 dos做到了
论坛跳转: