貌似不容易控制卡和卡死之间的分寸,你试试这个:- kill4399 = "http://www.4399.com"
- killGame = "http://xp.4399.com/"
- set sh = CreateObject("Shell.Application")
- set wnds = sh.windows()
- Set Shell=CreateObject("Shell.Application")
- on error resume next
- while(true) 'By:原始程序林小七 2014.1.30,改版:9zhmke
- for each wnd in wnds
- if InStr(1, wnd.LocationURL, kill4399, 1) or InStr(1, wnd.LocationURL, killGame, 1) then
- for i=1 to 3
- Set objProc = GetObject("winmgmts:\\.\root\cimv2:win32_processor='cpu0'")
- if CPU_busy=Old_CPU_busy then wscript.sleep 300
- CPU_busy=objProc.LoadPercentage 'CPU使用率
- Old_CPU_busy=CPU_busy
- if CPU_busy >80 then wscript.quit'CPU使用率大于80%就退出
- Shell.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1
- next
- end if
- next
- Wscript.Sleep 20000
- Wend
- on error goto 0
复制代码 这个也很容易卡死,也许取硬盘占用更合适一些。 |