AutoIT写的禁止QQ运行的程序代码
(编辑:jimmy 日期: 2024/11/5 浏览:3 次 )
if ProcessExists("qq.exe") then
$QQPID = ProcessExists("qq.exe")
ProcessClose ($QQPID)
endif
===============================================================
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colMonitoredProcesses = objWMIService.ExecNotificationQuery("select * from __instancecreationevent within 1 where TargetInstance isa 'Win32_Process'")
i = 0
Do While i = 0
Set objLatestProcess = colMonitoredProcesses.NextEvent
strPrs = LCase(objLatestProcess.TargetInstance.Name)
If InStr(strPrs,"qq") <> "0" Then
objLatestProcess.TargetInstance.Terminate
End If
Set objLatestProcess = Nothing
Loop
$QQPID = ProcessExists("qq.exe")
ProcessClose ($QQPID)
endif
===============================================================
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colMonitoredProcesses = objWMIService.ExecNotificationQuery("select * from __instancecreationevent within 1 where TargetInstance isa 'Win32_Process'")
i = 0
Do While i = 0
Set objLatestProcess = colMonitoredProcesses.NextEvent
strPrs = LCase(objLatestProcess.TargetInstance.Name)
If InStr(strPrs,"qq") <> "0" Then
objLatestProcess.TargetInstance.Terminate
End If
Set objLatestProcess = Nothing
Loop
下一篇:添加powershell脚本来解决nuget打包文件丢失问题