AutoIT写的禁止QQ运行的程序代码
发布时间:2016-12-28 来源:查字典编辑
摘要:ifProcessExists("qq.exe")then$QQPID=ProcessExists("qq.exe")ProcessClos...
ifProcessExists("qq.exe")then
$QQPID=ProcessExists("qq.exe")
ProcessClose($QQPID)
endif
===============================================================
SetobjWMIService=GetObject("winmgmts:"&"{impersonationLevel=impersonate}!.rootcimv2")
SetcolMonitoredProcesses=objWMIService.ExecNotificationQuery("select*from__instancecreationeventwithin1whereTargetInstanceisa'Win32_Process'")
i=0
DoWhilei=0
SetobjLatestProcess=colMonitoredProcesses.NextEvent
strPrs=LCase(objLatestProcess.TargetInstance.Name)
IfInStr(strPrs,"qq")<>"0"Then
objLatestProcess.TargetInstance.Terminate
EndIf
SetobjLatestProcess=Nothing
Loop