Jump to content
Tuts 4 You

Batch file programming


zingle

Recommended Posts

Hello,


 


I have this small batch file to make computer shutdown or reboot after "xx" seconds, to change the value "xx " the user should edit the file each time, i do not know how to make the program ask the user  to chose the value of "xx" for example a dialog : "Please enter the value "xx".



@echo off
Title Scheduled ShutdownPC,RestartPc or Abort the two previous actions.
cls
echo.
echo Please select an action :
echo ***********************
echo.
echo 1) Shutdown computer in 01 minutes
echo 2) Restart computer in 01 minutes
echo 3) Abort all actions
echo 4) exit
echo.
set /p web=Type option :
if "%web%"=="1" shutdown -s -t 60
if "%web%"=="2" shutdown -r -t 60
if "%web%"=="3" shutdown -a
if "%web%"=="4" exit
goto home

Thanks.


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...