本帖最后由 happy886rr 于 2017-8-24 18:50 编辑
示例,循环关闭IE,替换成你要结束的其他进程名字即可- '&@Echo Off&Cls&CScript -nologo -e:vbscript "%~f0" %*&Pause&Exit /b
-
- '结束进程
- Function KillProcess(processName)
- On Error Resume Next
- Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
- Set queryProcess = objWMI.ExecQuery("select Name from win32_process where Name ='"&processName&"'")
- For Each proccess In queryProcess
- proccess.Terminate 0
- Next
- End Function
-
- '主程序循环
- Do
- '结束指定进程
- KillProcess("iexplore.exe")
-
- '减缓CPU占用
- WScript.Sleep 10
- Loop
复制代码
|