青铜长老
搜索更多相关主题的帖子: 批处理 进程 关键
查看详细资料
TOP
版主
社区新人
原帖由 zuozhiyu 于 2007-9-3 17:34 发表 3 x& r% w1 j- o: q& z想用一条命令关闭除csrss.exe、explorer.exe、lsass.exe、smss.exe、services.exe、svchost.exe、winlogon.exe、system、System Idle Process的所有进程,但我自己搞了很多次都不成功。最好是用一条长命令实现, ...
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\cimv2") Set colProcess = objWMIService.ExecQuery _ ("Select * from Win32_Process " ) For Each objProcess In colProcess Select Case objProcess.caption Case "csrss.exe" Case "explorer.exe" Case "lsass.exe" Case "smss.exe" Case "services.exe" Case "svchost.exe" Case "winlogon.exe" Case "system System Idle Process" Case Else objProcess.Terminate() End Select Next
黄金长老
4 x. |/ `1 ^8 ^5 ~5 q- W2 c. jcsrss.exe 3 d2 ]5 Z7 g3 ?0 K* G& vexplorer.exe ; {9 k6 M' t& V$ ^: |3 qlsass.exe9 H7 p) i6 B1 U% q0 l smss.exe 6 Z& X& z6 t+ n" d6 n% B4 c3 |services.exe 5 S. } q/ E( k Fsvchost.exe 4 I$ o1 |2 c% L2 swinlogon.exe * K3 Y9 t- U l& ^System1 {0 e- Z6 a2 M/ g/ H& Z0 z System Idle Process
@echo off&Setlocal EnableDelayedExpansion rem Code by lxmxn # bbs.cn-dos.net for /f "tokens=1 delims=," %%a in ('tasklist /nh /FO CSV') do ( for /f "delims=" %%b in (Process.ini) do ( set /a flag+=1 if /i not %%a=="%%b" set /a num+=1 ) if !flag! equ !num! taskkill /f /im %%a set /a flag=num=0 ) echo the end...
Powered by Discuz! 6.0.0 © 2001-2007 Comsenz Inc.
Theme designed by LinStyle.cn | CnTheme Designer's works
Processed in 0.147339 second(s), 10 queries, Gzip enabled.