一个快速而肮脏的选择是从
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