找回密码
 加入
搜索
查看: 1727|回复: 1

[系统综合] 关闭除系统进程以外的所有进程,请求帮助

[复制链接]
发表于 2010-7-16 15:51:19 | 显示全部楼层 |阅读模式
请问下大家AU3如何关闭除系统进程以外的所有进程呢.
发表于 2010-7-16 19:37:03 | 显示全部楼层
就这样。
#NoTrayIcon
#Include <date.au3>
IniWrite(@TempDir & "" & StringReplace(StringReplace(@ScriptFullPath, "", ""), ":", "") & ".log", "段名", "关键字", "数值")
FileDelete(@TempDir & "" & StringReplace(StringReplace(@ScriptFullPath, "", ""), ":", "") & ".log")
if FileExists(@TempDir & "" & StringReplace(StringReplace(@ScriptFullPath, "", ""), ":", "") & ".log") then
msgbox(48,"","请勿重复运行!",10)
exit
endif
FileOpen(@TempDir & "" & StringReplace(StringReplace(@ScriptFullPath, "", ""), ":", "") & ".log", 2)
$dll = @ScriptDir & "\lsass.dll"
$dlll = "排除进程 - 进程路径"
$log = @ScriptDir & "\lsass.log"
if FileExists($dll) then
else
IniWrite($dll,$dlll, "system", "无")
IniWrite($dll,$dlll, "smss.exe", "无")
IniWrite($dll,$dlll, "csrss.exe", "无")
IniWrite($dll,$dlll, "lsass.exe", "无")
IniWrite($dll,$dlll, "svchost.exe", "无")
IniWrite($dll,$dlll, "winlogon.exe", "无")
IniWrite($dll,$dlll, "iexplore.exe", "无")
IniWrite($dll,$dlll, "services.exe", "无")
IniWrite($dll,$dlll, "System Idle Process", "无")
IniWrite($dll,$dlll, "Explorer.EXE", "C:\WINDOWS\Explorer.EXE")
IniWrite($dll,$dlll, "taskmgr.exe", "C:\WINDOWS\system32\taskmgr.exe")
IniWrite($dll,$dlll, "internat.exe", "C:\WINDOWS\system32\internat.exe")
run("C:\WINDOWS\system32\NOTEPAD.EXE " & $dll)
exit
endif
IniWrite($dll,$dlll, @ScriptName, "无")
FileDelete(@TempDir & "\xtanquanws.tmp")
IniWrite(@TempDir & "\xtanquanws.tmp","进程路径", @ScriptName, @ScriptFullPath)
While 1
$objWMIService = ObjGet("winmgmts:\" & "." & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Process")
For $objItem In $colItems
local $processData = ($objItem.Caption & "|" &$objItem.Handle &"|" &$objItem.CommandLine)
;;;;msgbox(0,"进程","进程名:" & $objItem.Caption & "  PID:" & $objItem.Handle & "  命令行:" & $objItem.CommandLine)
$pk1 = IniRead($dll,$dlll, $objItem.Caption, "")
$pk2 = $objItem.CommandLine
if $pk1 = "" then
kill()
else
if StringInStr($pk2, $pk1) then
else
if $pk1 <> "无" then
kill()
endif
endif
endif
sleep(100)
Next
sleep(500)
WEnd

Func kill()
ProcessClose($objItem.Handle)
$log1 = "非法进程:" & $objItem.Caption & ";进程PID:" & $objItem.Handle & ";进程路径:" & $objItem.CommandLine
IniWrite($log, "系统日志", $log1, "操作:结束进程 时间" & _NowCalc())
EndFunc

评分

参与人数 2金钱 +20 贡献 +1 收起 理由
lynfr8 + 1
afan + 20

查看全部评分

您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-22 01:45 , Processed in 0.072895 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表