一个快速而肮脏的选择是从
Microsofts Sysinternals开始在
PSTOOLS套件中使用
PSSHUTDOWN.
其中一个可用的开关是-c.它允许用户通过按“取消”按钮停止重新启动.
-c Allows the shutdown to be aborted by the interactive user.
您可以将其设置为每X分钟循环一次,直到用户准备好重新启动计算机.
一个更简洁的方法是编写自己的VBscript.这可以提供一个时髦的对话框,例如,是和否.如果他们点击否,它会在再次询问之前睡眠X分钟.这很容易写.
编辑:嗯,我很无聊所以我为你制作了剧本.请享用.
option explicit on error resume next Dim strComputer,intRebootChoice Dim objWMIService,objOperatingSystem Dim colOperatingSystems strComputer = "." do while 1>0 intRebootChoice = msgBox("OI,you,need to reboot. Choose No to be asked again 1 hour",308,"Reboot incoming") select case intRebootChoice case 6 Set objWMIService = Getobject("winmgmts:" & "{impersonationLevel=impersonate,(Shutdown)}!\\" & strComputer & "\root\cimv2") Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem") For Each objOperatingSystem in colOperatingSystems ObjOperatingSystem.Reboot(1) Next case 7 wscript.sleep(3600000) case else 'shenanigans' end select loop
原文地址:https://www.jb51.cc/windows/366167.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。