Force Reboot AutoIt Script

Sometimes in our environment we need to force reboot some machines, here is the AutoIt script to do the job for us.

The reboot command will be first to run before user gets the notification about the reboot. So even if a user close the pop up window, the reboot still goes. and the user has two times notification. First is 30min before reboot, and second is 10min before the reboot.

 

#include <MsgBoxConstants.au3>
Run(“c:\windows\system32\Shutdown.exe -r -t 1800”)
sleep(3000)
MsgBox(262144, “System Maintenance Alert!”, “You have less than 30 minutes before the force reboot..Please save your work!!! Thank you and we appreciate your cooperation.”,1200)
Sleep(1200000)
MsgBox(262144, “System Maintenance Alert!”, “You have less than 10 minutes before the force reboot..Please save your work!!! Thank you and we appreciate your cooperation.a