如果你家有中老年人沉迷游戏,请帮助他们

脚本请另存为 关爱行动.vbs

如果你有装杀毒软件,请放行

'加入启动菜单
Dim fso,ws,pt,msg 
Set fso = createobject("scripting.filesystemobject") 
Set ws = createobject("wscript.shell") 
Set file = fso.getfile(wscript.scriptfullname)
pt = ws.specialfolders("startup") & "\"
 file.copy pt 
sub Close_Process(ProcessName) 
On Error Resume Next
end sub

Dim objWShell
Dim pipe
Dim minute

'自定义时间生效
'Do
'minute = InputBox("Auto close timer, unit minute")
'Loop Until IsNumeric(minute)

do
Set objWShell=GetObject("winmgmts:\\.\root\cimv2")
Set pipe=objWShell.execquery("select * from win32_process where name='zjz.exe'")
for each i in pipe
i.terminate()
next
'改为每次随机启动
randomize
minute = round(Rnd * 35 + 1)
'msgbox(minute)
wscript.sleep 1000*60*minute
loop

添加其它的需要关闭的进程

where name='zjz.exe' or name = 'xxx.exe'

如果你想某天让Ta开心的玩游戏

Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.Run "taskkill /f /im wscript.exe", 0, True
oShell.Run "taskkill /f /im wmiprvse.exe", 0, True

题外话

什么时候会有“中老年防沉迷机制”呢?
也许不会有,毕竟已经努力了大半辈子了;
也许会有,因为他们的身体也努力了大半辈子了。