VBS 断网后自动关机30秒后
程序员文章站
2022-04-29 09:20:50
复制代码 代码如下:dim wsh,objwmiservice,colmonitoredevents set wsh = wscript.createobject("wsc...
复制代码 代码如下:
dim wsh,objwmiservice,colmonitoredevents
set wsh = wscript.createobject("wscript.shell")
set objwmiservice = getobject("winmgmts:\. ootwmi")
set colmonitoredevents = objwmiservice.execnotificationquery("select * from msndis_statusmediadisconnect")
do while true
set strlatestevent = colmonitoredevents.nextevent
wsh.run "shutdown -s -t 30 -c "&chr(34)&"系统网络断开,机器即将关闭"&chr(34)
loop
上一篇: vbs教程 chm下载
下一篇: 屏蔽端口的vbs脚本