在可板块看到了,搞不明白是什么原理- On Error Resume Next
- dim wmi,proc,procs,proname,flag,WshShell,fso,f
- set fso=CreateObject("Scripting.FileSystemObject")
- set WSHshell = wscript.createobject("wscript.shell")
- set f=fso.opentextfile("X.tmp",8)
- Do
- proname="cmd.exe"
- set wmi=getobject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
- set procs=wmi.execquery("select * from win32_process")
- flag=true
- for each proc in procs
- if strcomp(proc.name,proname)=0 then
- flag=false
- exit for
- end if
- next
- set wmi=nothing
- if flag then
- WshShell.Run "进程保护.bat",0,true
- end if
- loop
复制代码 http://bbs.bathome.net/thread-63314-1-1.html |