I see there are some topics related to my question but there is something missing, I need to create a batch that reboots the computer and send a pop; I have this:
@echo off
cd c:\windows\system32
shutdown -r -t 600 -c "Your machine you need to reboot in 5 minutes." -f
exit
However I need something more, I need a reminder of 2 minutes before the computer reboots, and there is a way that the user can stop or propose a new time before the computer restart.
@echo off
shutdown -r -t 300 -c "Your machine you need to reboot in 5 minutes."
Echo Press any key to cancel
timeout /t 180
Echo 2 mins to go
timeout /t 9999
shutdown /a
For general help. Type Help in the command prompt. For each command listed type help <command> (eg help dir) or <command> /? (eg dir /?).
You can try something like that :
@echo off
shutdown -r -t 600 -c "Your machine you need to reboot in 5 minutes." -f
Call :AskQuestion
exit
::***********************************************************************
:AskQuestion
(
echo Set Ws = CreateObject("wscript.shell"^)
echo wscript.sleep 180000
echo Answ = MsgBox("Did you want to cancel the scheduled reboot of your the computer ?"_
echo ,VbYesNo+VbQuestion,"Did you want to cancel the scheduled reboot of your the computer ?"^)
echo If Answ = VbYes then
echo Return = Ws.Run("cmd /c Shutdown -a",0,True^)
echo Else
echo wscript.Quit(1^)
echo End If
)>"%tmp%\%~n0.vbs"
Start "" "%tmp%\%~n0.vbs"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With