1.关机脚本(shutdown1.vbs):
Set colOperatingSystems = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
    ObjOperatingSystem.Win32Shutdown(8)
Next

2.延时60秒,在关机前提示,可以在延时到达前取消关机(shutdown2.vbs脚本):
set wshshell = CreateObject("WScript.Shell")
timeout = 60
'Time Out 可以自己定义
ask = "系统将在 " & timeout & " 秒钟后关机!"
title = "自动关机提示"
constants = vbExclamation + vbOkCancel
result = wshshell.Popup(ask, timeout, title, constants)
if result = vbCancel then
elseif result = true then
Set colOperatingSystems = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(8)
Next
end if

相关文章:

  • 2021-08-08
  • 2022-12-23
  • 2022-02-01
  • 2021-12-20
  • 2021-09-08
  • 2022-12-23
  • 2021-07-07
  • 2021-06-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2021-11-05
  • 2021-07-18
  • 2021-11-11
相关资源
相似解决方案