Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Credits 4 Posts 2 Joined 2007-03-06 23:00 19-year member UID 80935 Gender Male
Status Offline
@echo off
color a
title Shutdown Program
:sta
cls
echo.
echo.
echo.
echo Shutdown Program
echo.
echo.
echo 1. Log Off Computer
echo.
echo 2. Restart Computer
echo.
echo 3. Schedule Shutdown of Computer
echo.
echo 4. Cancel Scheduled Shutdown
echo.
echo 0. Return to Main Menu
echo.
set no=:
set /p no= Please select:
set "no=%no:"=%"
if "%no%"=="0" goto _0
if "%no%"=="1" goto _1
if "%no%"=="2" goto _2
if "%no%"=="3" goto _3
if "%no%"=="4" goto _4
:_0
cls
goto sta
:_1
cls
set no=:
set /p yn=Confirm execution (y/n):
set "no=%noyn"=%"
if "%yn%"==y "shutdown -l" rem Why does this part continue to execute the title after execution
:_2
shutdown -r -t 0
:_3
set no=:
echo If the entered number is 0, it will return to the main menu
set /p tim= Please enter shutdown time:
set "no=%no:"=%"
if "%tim%"=="0" goto sta
shutdown -s -t %tim%
:_4
shutdown -a
rem This mark will execute automatically
Credits 4 Posts 2 Joined 2007-03-06 23:00 19-year member UID 80935 Gender Male
Status Offline
@echo off
color a
title Shutdown Program
:sta
cls
echo.
echo.
echo.
echo Shutdown Program
echo.
echo.
echo 1. Log Off Computer
echo.
echo 2. Restart Computer
echo.
echo 3. Schedule Shutdown of Computer
echo.
echo 4. Cancel Scheduled Shutdown
echo.
echo 0. Return to Main Menu
echo.
set no=:
set /p no= Please select:
set "no=%no:"=%"
if "%no%"=="0" goto _0
if "%no%"=="1" goto _1
if "%no%"=="2" goto _2
if "%no%"=="3" goto _3
if "%no%"=="4" goto _4
:_0
cls
goto sta
:_1
cls
set no=:
set /p yn=Confirm execution (y/n):
set "no=%noyn"=%"
if "%yn%"==y "shutdown -l" rem Why does this section continue to execute the title after execution
:_2
shutdown -r -t 0
:_3
set no=:
echo If the entered number is 0, it will return to the main menu
set /p tim= Please enter shutdown time:
set "no=%no:"=%"
if "%tim%"=="0" goto sta
shutdown -s -t %tim%
:_4
shutdown -a
rem This mark will execute automatically