Schedule a PC Shutdown

Page 1 of 2 12 LastLast

  1. Posts : 4,677
    Windows 11 Pro 64-bit
       #1

    Schedule a PC Shutdown


    With this batch script computer can be scheduled for shutdown at given minutes.


    Code:
    :: This batch script created by FreeBooter
    
    @Echo Off
    
    Color 5f
    
    Mode 65,20
    Echo.
    Echo.
    Echo.
    Echo.
    Echo.
    Echo.
    Echo      Enter a Time (in Minutes ) to Schedule a PC Shutdown
    Echo.
    Echo.
    Echo.
    Echo.
    Echo     Type (Y) Letter to Cancel Previously Scheduled Shutdown
    
    Set /p time=^>
    
    If /i Not %time%==Y (Goto Ex) Else (Goto Cancel)
    
    :Ex
    
    Set minutes=%time%
    
    Set /a time=%time%*60
    
    If %time% GEQ 1  (Goto Schedule) Else (Goto Cancel)
    
    
    :Schedule 
    
    Shutdown -s -t %time%
    
    Cls
    
    Echo.
    Echo.
    Echo.
    Echo.
    Echo.
    Echo.
    Echo.
    Echo.
    Echo.
    Echo           In %minutes% Minutes Computer Will Shutdown
    
    Ping -n 9 localhost > Nul
    
    Exit
    
    :Cancel 
    
    Shutdown /a 
    
    Cls
    
    Echo.
    Echo.
    Echo.
    Echo.
    Echo.
    Echo.
    Echo.
    Echo.
    Echo.
    Echo             The Scheduled Shutdown Event Canceled
    
    Ping -n 9 localhost > Nul
    
    Exit
      My Computer


  2. Posts : 108
    Windows 10 64bit
       #2

    Forgive me but why would a batch file be needed to do something that can be accomplished jut by using Task Scheduler that is already built into the computer?
      My Computers


  3. Posts : 17,832
    Windows 10
       #3

    Schedule a PC Shutdown-002114.png
      My Computer


  4. Posts : 4,677
    Windows 11 Pro 64-bit
    Thread Starter
       #4

    notnats said:
    Forgive me but why would a batch file be needed to do something that can be accomplished jut by using Task Scheduler that is already built into the computer?
    You want to use Task Scheduler you can but this script makes it easy to schedule a shutdown.
      My Computer


  5. Posts : 108
    Windows 10 64bit
       #5

    FreeBooter said:
    You want to use Task Scheduler you can but this script makes it easy to schedule a shutdown.
    That may be but having worked on a number of forums over the years there and helping folks with widely varying computer knowledge I know that are many, many people, who just are not comfortable using a batch file which is why I mentioned the Task Scheduler.
      My Computers


  6. Posts : 4,677
    Windows 11 Pro 64-bit
    Thread Starter
       #6

    Tell you the true Task Scheduler is not easy to setup.
      My Computer



  7. Posts : 108
    Windows 10 64bit
       #7

    FreeBooter said:
    Tell you the true Task Scheduler is not easy to setup.
    Well yes, I will give you that. But it is available. That said, the program noted by Edwin looks interesting and easy but since he gave no info except the print screen of the program it is kind of hard to judge. He didn't give the name or a link to the program which would have been nice and instructive.
      My Computers


  8. Posts : 13,961
    Windows 10 Pro X64 21H1 19043.1503
       #8

    The nice thing about the batch file is it means you don't have to do the math to convert seconds to minutes, it does it for you.

    As for the one Edwin posted: Moo Simple Timer (title bar of app):
      My Computers


  9. Posts : 4,677
    Windows 11 Pro 64-bit
    Thread Starter
       #9

    Ztruker said:
    The nice thing about the batch file is it means you don't have to do the math to convert seconds to minutes, it does it for you.

    As for the one Edwin posted: Moo Simple Timer (title bar of app):
    Thank you.
      My Computer


  10. Posts : 108
    Windows 10 64bit
       #10

    Thanks for the info. Note that the Moo Simple Timer has not been updated in 6 years, "Update (2013/08/17)"
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 03:19.
Find Us




Windows 10 Forums