0

I need to create a batch script that will run a reboot command but give you the option to stop the script with "the push of any key".
Ultimately I want to add it to my scheduled tasks set at 3:00 am and have it countdown from 30 minutes. I want to give it the thirty minutes in case a user is away from a PC and it initiates while they are still working on it.

shutdown -r -t 1800

press any key to abort (this part I don't know how to do)

Matt P
  • 618
  • 2
  • 12
  • 20

1 Answers1

1

Put:

pause
shutdown -a 

If user does not (navigate to cmd window and) and press 'a key', timer will elapse and shutdown will start, otherwise it will be aborted

wmz
  • 3,645
  • 1
  • 14
  • 22