码迷,mamicode.com
首页 > Windows程序 > 详细

windows进程清理脚本

时间:2015-03-16 09:50:08      阅读:308      评论:0      收藏:0      [点我收藏+]

标签:windows   批处理   脚本   taskkill   

公司统一配的笔记本Thinkpad T440p,超级难用,经常内存占满,硬盘卡死,还管不了机!心里那个不爽啊!哎,不说了。

自己写了个脚本,用来强制关闭不需要的进程。脚本如下:

---------------------------------killtask.bat--------------------------------------

@echo off & setlocal enabledelayedexpansion

rem 如下列表是不需要关闭的进程,可以自行添加
set alt=aasd
rem set alt=%alt% ChsIME.exe
rem set alt=%alt% ClassicStartMenu.exe
set alt=%alt% EvtEng.exe
set alt=%alt% IsaHelp.exe
set alt=%alt% Jhi_service.exe
set alt=%alt% LMS.exe
set alt=%alt% Monitor.exe
set alt=%alt% NvBackend.exe
set alt=%alt% OSPPSVC.EXE
set alt=%alt% OmniServ.exe
set alt=%alt% PWMDBSVC.exe
set alt=%alt% PresentationFontCache.exe
set alt=%alt% RegSrvc.exe
set alt=%alt% SMSvcHost.exe
set alt=%alt% SangforPromoteService.exe
set alt=%alt% SynTPEnh.exe
rem set alt=%alt% SynTPHelper.exe
rem set alt=%alt% SynTPLpr.exe
set alt=%alt% System
set alt=%alt% System Idle Process
set alt=%alt% TNSLSNR.EXE
rem set alt=%alt% TXPlatform.exe
rem set alt=%alt% TpShocks.exe
set alt=%alt% WUDFHost.exe
set alt=%alt% WmiPrvSE.exe
set alt=%alt% ZeroConfigService.exe
set alt=%alt% audiodg.exe
set alt=%alt% cmd.exe
set alt=%alt% conhost.exe
set alt=%alt% csrss.exe
set alt=%alt% dasHost.exe
set alt=%alt% devmonsrv.exe
set alt=%alt% dllhost.exe
set alt=%alt% dwm.exe
set alt=%alt% explorer.exe
set alt=%alt% extapsup.exe
set alt=%alt% iSCTAgent.exe
set alt=%alt% igfxCUIService.exe
set alt=%alt% igfxEM.exe
set alt=%alt% igfxHK.exe
set alt=%alt% inetinfo.exe
set alt=%alt% loctaskmgr.exe
set alt=%alt% lpdagent.exe
set alt=%alt% lsass.exe
set alt=%alt% micmute.exe
set alt=%alt% nvSCPAPISvr.exe
set alt=%alt% nvvsvc.exe
set alt=%alt% nvxdsync.exe
set alt=%alt% obexsrv.exe
rem set alt=%alt% opvapp.exe
rem set alt=%alt% oracle.exe
set alt=%alt% rundll32.exe
set alt=%alt% services.exe
set alt=%alt% smss.exe
set alt=%alt% spoolsv.exe
set alt=%alt% svchost.exe
set alt=%alt% taskhostex.exe
set alt=%alt% tasklist.exe
set alt=%alt% unsecapp.exe
set alt=%alt% wininit.exe
set alt=%alt% winlogon.exe
set alt=%alt% wlanext.exe
set alt=%alt% wuauclt.exe
set alt=%alt% QuickControlInput.exe
set alt=%alt% QuickControlService.exe
set alt=%alt% ZhuDongFangYu.exe
set alt=%alt% 360tray.exe
rem set alt=%alt% UEStudio.exe

for /F "usebackq tokens=1" %%i in (`tasklist /NH`) do (
rem for /F "usebackq tokens=1" %%i in (tasklist.txt) do (
  set result=NO
  call :InStrArray %%i
  if !result!==OK (
   @echo %%i !result! ,不需要停止
  ) else (
   taskkill /F /IM %%i
  )
)
goto endoff

rem call :InStrArray ui.wu
rem @echo %result%

goto endoff

rem 删除指定后缀文件的批处理函数
:InStrArray
set %result%=NO
for %%i in (%alt%)  do (
 if "%1"=="%%i" (
   set result=OK
   goto endoff
 )
)


:endoff


---------------------------------------------------------------------------------------------------

将横线中间部分复制出来,粘贴到记事本中,保存为killtask.bat。

使用方法:右键点击killtask.bat,弹出菜单中选择以管理员身份运行。





windows进程清理脚本

标签:windows   批处理   脚本   taskkill   

原文地址:http://blog.csdn.net/chl0000/article/details/44300753

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!