Saturday, June 19, 2010

Scheduled Shutdown / Restart

::~Instructions start with ::~

::~Open notepad

::~Copy and paste the code below.

@echo off
title Shutdown Timer
Color 1f
:menu
cls
time /t
echo.
echo Welcome to shutdown timer!
echo.
echo Stop shutdown or create new?
echo.
echo C=Create New
echo A=Abort
echo E=Exit
echo.
set input=
set /p input=
if %input%==a goto stop
if %input%==A goto stop
if %input%==e exit
if %input%==E exit
if %input%==C goto 1
if %input%==c goto 1
goto menu
:1
cls
time /t
echo.
echo Welcome to shutdown timer!
echo.
echo Shutdown or Restart? (S/R)
echo.
set input=
set /p input=
if %input%==R set x=r
if %input%==r set x=r
if %input%==S set x=s
if %input%==s set x=s
cls
time /t
echo.
echo Welcome to shutdown timer!
echo.
echo Enter time when to shutdown in following format:
echo h:mm:ss.mm
echo Example: 17:47:00.00 would shutdown at 5:47. (Uses a 24 hour clock)
set /p time=
cls
time /t
echo.
echo Welcome to shutdown timer!
echo.
echo Enter message: (Can't use spaces, use underscores, commas, or periods)
set /p message=
at %time% /interactive shutdown -%x% -t 30 -c %message%
cls
time /t
echo.
echo Welcome to shutdown timer!
echo.
echo The computer will shutdown at %time%, with message: %message%
echo.
pause
goto Menu
:stop
at 1 /delete
at 2 /delete
at 3 /delete
at 4 /delete
at 5 /delete
at 6 /delete
at 7 /delete
at 8 /delete
at 9 /delete
at 10 /delete
shutdown -a
cls
time /t
echo.
echo Welcome to shutdown timer!
echo.
echo Shutdown has been deleted.
echo.
pause
goto menu

::~Then save as (anything).bat

No comments:

Post a Comment