Okay I am making a batch file to start a delayed shutdown. However I am having problems with multiplying a variable by 60 (to calculate minutes into seconds).
Here is what I have.:SHUTDOWN2
echo The system is set to shutdown in "%timer%" minutes. This is correct?
pause
echo set /a timerfix=%timer%*60
echo shutdown -s -t %timerfix%
set/p "Command=>"
if %Command%==yes goto END
if %Command%==no goto ABORTNow all I want to know is why this isn't working. I mean I'm sure I have it all worded correctly.
Any help? Thanks in advance.
You don't show how %timer% is set. So no idea what is wrong.
=====================================
Life is too important to be taken seriously.M2
@echo off
goto START
:START
cls
title Windows Shutdown Delay
echo Hello Wezz. Command?
set/p "Command=>"
if %Command%==shutdown goto SHUTDOWN
echo Invalid command, Type help for a list of valid commands.
pause
goto START:SHUTDOWN
echo Shutdown loaded. Enter minutes.
set/p "timer=>"
goto SHUTDOWN2:SHUTDOWN2
echo The system is set to shutdown in "%timer%" minutes. This is correct?
pause
echo set /a timerfix=%timer%*60
echo shutdown -s -t %timerfix%
set/p "Command=>"
if %Command%==yes goto END
if %Command%==no goto ABORT:ABORT
echo ABORT
pause:END
echo Shutting down.
pause
exitFull Batch file.
I believe that
set /p command="Command=>"
and
I believe that set /p timer="timer=>"
set /a timer=%timer%might work better. You aren't setting a variable this way
set/p "Command=>"
mike
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |