A quick and dirty option would be to use PSSHUTDOWN in the PSTOOLS suite from Microsofts Sysinternals.
One of the switches available is -c
. It allows the user to stop the reboot by pressing the Cancel button.
-c Allows the shutdown to be aborted by the interactive user.
You could set this to loop every X minutes until the user is ready to have their machine rebooted.
A
neater way to do this would be to write your own VBscript. This could provide a snazzy dialog box offering, for example,
Yes and
No. If they clicked No, it would sleep for X minutes before asking again. This would be very easy to write.
Edit: Well, I was bored so I made the script for you. Enjoy.
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