AutoIT写的禁止QQ运行的程序代码
View Code
1 if ProcessExists("qq.exe") then
2 $QQPID = ProcessExists("qq.exe")
3 ProcessClose ($QQPID)
4 endif
5
6
7 ===============================================================
8 Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
9 Set colMonitoredProcesses = objWMIService.ExecNotificationQuery("select * from __instancecreationevent within 1 where TargetInstance isa 'Win32_Process'")
10 i = 0
11 Do While i = 0
12 Set objLatestProcess = colMonitoredProcesses.NextEvent
13 strPrs = LCase(objLatestProcess.TargetInstance.Name)
14 If InStr(strPrs,"qq") <> "0" Then
15 objLatestProcess.TargetInstance.Terminate
16 End If
17 Set objLatestProcess = Nothing
18 Loop
19
2
1 if ProcessExists("qq.exe") then
2 $QQPID = ProcessExists("qq.exe")
3 ProcessClose ($QQPID)
4 endif
5
6
7 ===============================================================
8 Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
9 Set colMonitoredProcesses = objWMIService.ExecNotificationQuery("select * from __instancecreationevent within 1 where TargetInstance isa 'Win32_Process'")
10 i = 0
11 Do While i = 0
12 Set objLatestProcess = colMonitoredProcesses.NextEvent
13 strPrs = LCase(objLatestProcess.TargetInstance.Name)
14 If InStr(strPrs,"qq") <> "0" Then
15 objLatestProcess.TargetInstance.Terminate
16 End If
17 Set objLatestProcess = Nothing
18 Loop
19
2
2 $QQPID = ProcessExists("qq.exe")
3 ProcessClose ($QQPID)
4 endif
5
6
7 ===============================================================
8 Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
9 Set colMonitoredProcesses = objWMIService.ExecNotificationQuery("select * from __instancecreationevent within 1 where TargetInstance isa 'Win32_Process'")
10 i = 0
11 Do While i = 0
12 Set objLatestProcess = colMonitoredProcesses.NextEvent
13 strPrs = LCase(objLatestProcess.TargetInstance.Name)
14 If InStr(strPrs,"qq") <> "0" Then
15 objLatestProcess.TargetInstance.Terminate
16 End If
17 Set objLatestProcess = Nothing
18 Loop
19
2
转载请注明文章出处:http://www.cnblogs.com/gredswsh Gredswsh 专栏