首页 > 编程 > VBScript > 正文

VBS 断网后自动关机30秒后

2020-07-26 11:52:25
字体:
来源:转载
供稿:网友
复制代码 代码如下:

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
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表