• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

Gredswsh的技术生活

Java,Python,Go,SCI_NUM
  • 联系
  • 订阅
  • 管理

公告

View Post

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

转载请注明文章出处:http://www.cnblogs.com/gredswsh   Gredswsh  专栏

posted on 2011-06-02 11:24  fxcl  阅读(415)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3