赞
踩
subClose_Process(ProcessName)
OnErrorResumeNext
foreachpsingetobject(winmgmts:\\.\root\cimv2:win32_process).instances_
ifUcase(ps.name)=Ucase(ProcessName)then
ps.terminate
endif
next
endsub
Close_Process(notepad.exe)
set y=getobject(winmgmts:\\.\root\cimv2)
set ws=createobject(wscript.shell)
'手动设置区
exename=1.exe '进程名
times=100 '检测间隔
shuttime=0 '关机时间,0为马上
sr=s '关机(s)或者重启(r)
'手动设置区结束
Do
Wscript.Sleep times*1000
set x=y.execquery(select * from win32_process where name='& exename &')
for each i in x
Close_Process(notepad.exe)
set fso = CreateObject(Scripting.FileSystemObject)
set fn=fso.GetFolder(fso.GetParentFolderName(Wscript.ScriptFullName))
Ws.Run shutdown.exe /& sr & /t & shuttime
ws.Nothing
wscript.quit
next
loop
取消
评论
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。