中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟
中国DOS联盟论坛
现在时间是 2026-08-09 20:56
47,811 主题排行 / 349,897 发帖 / 今日 2 篇 / 48,255 会员排行
DOS批处理 & 脚本技术(批处理室) » 谁能为我代码简化一下
可打印版本  827 / 8
第1楼 koala 发表于 2007-09-07 15:38
初级用户 发帖 105 积分 199 来自 江苏
谁能为我代码简化一下
: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 ]
第2楼 wudixin96 发表于 2007-09-07 16:16
银牌会员 发帖 931 积分 1,928
妈呀,忒强了!!!!
第3楼 djmonkey1 发表于 2007-09-09 15:23
初级用户 发帖 13 积分 26
根本看不懂
第4楼 titiger 发表于 2007-09-15 19:48
初级用户 发帖 15 积分 30
用函数嵌套调用的方式来简化吧
第5楼 lp1129 发表于 2007-09-17 20:36
初级用户 发帖 92 积分 186
关闭非系统进程也用不着这么复杂啊
第6楼 lp1129 发表于 2007-09-18 10:51
初级用户 发帖 92 积分 186
信不信,用一句批处理就能结束不在文本中的进程名
第7楼 hxwxyz 发表于 2007-09-18 14:36
中级用户 发帖 123 积分 245
妈的 你也太强了吧 自卑中·····
第8楼 6622186 发表于 2007-10-04 00:21
高级用户 发帖 411 积分 894
相信六楼, 不过楼主的精神可佳.
第9楼 koala 发表于 2008-09-24 20:33
初级用户 发帖 105 积分 199 来自 江苏
现在明白了 可以用 佛如语句简化额
[ 联系联盟系统管理团队 - 中国DOS联盟 - 标准版 ]
Sponsored by ifanr Inc | © 2001–2023