用VB脚本强行关闭进程如何实现?

来源:百度知道 编辑:UC知道 时间:2024/09/22 19:46:35
如我列出一串进程名
当我运行VBS的时候VBS能关闭这些进程
但是不破坏
高手指点

呵呵,我转贴的:

on error resume next

killname="ascii.exe|a.exe|b.exe" '要kill的进程名字,用"|"分割开

kill=Split(killname,"|")

While True
for i=1 to 60 '每分钟kill一次,60就是60秒的意思
wscript.sleep 1000
next
call kl
Wend

Private Sub kl()
for each ps in getobject("winmgmts:\\.\root\cimv2:win32_process").instances_
for each name in kill
if LCase(ps.name)=LCase(name) then
ps.Terminate
end if
next
next
end sub