Automatic on Time Based Shutdown in Batch

Manage PC power on, shutdown, logoff and sleep modes of your own PC - even if you have to set time to shut down your PC.The great thing is that , for doing , this type of stuff you do not need to download any Software or any thingYou just need Copy and Paste these lines of codes to your notepad  and save it with bat extension like (shutdown-batch.bat).

Irritated with the fact that some applications just don't go well together with Window's Hibernate or Suspend features? 
Batch Script :
@echo off
    color 3
    title Time Based Shutdown
    set /p fullname="Enter a name:"
     
    :start
    cls
    echo Hi, %fullname%
    echo.
    echo 1.Shutdown
    echo 2.Quit
     
    :invalid_choice
    set /p choice="enter your choice 1,2: "
    if %choice%==1 goto shutdown
    if %choice%==2 exit
    echo invalid choice: %choice%
    goto invalid_choice
     
    :shutdown
    cls
    set /p sec="Enter the number of seconds that you wish the computer to shutdown in: "
    set /p message="Enter the shutdown message you wish to display: "
    shutdown -s -f -t %sec% -c "%message%"
    echo shutdown initiated at %time%
    set /p cancel="type cancel to stop shutdown "
    if %cancel%==cancel shutdown -a
    if %cancel%==cancel goto start

1 comment:

Comment On Facebook