1.

Solve : writing a simple batch file to shutdown pc in x minutes?

Answer»

Hi - I currently have many xp shortcuts in a folder that ALLOW me to shut down my pc in x number of SECONDS   For example I'm using C:\WINDOWS\system32\shutdown.exe -f -s -t 2400   in a shortcut to shut down in 40 minutes. 

I'm trying to write a batch file that will prompt me for the number of MINUTES in which the pc should shut down.

Can some one help me fill in the BLANKS here - I don't know what I'm doing...  thanks, Jami

echo off
echo Minutes until shut down?
echo.
rem enter minutes press - then hit enter
set /p min=[promptString]

rem multiplies minutes by 60 for seconds (sec)

rem drops the product into the shutdown statement
C:\WINDOWS\system32\shutdown.exe -f -s -t sec


CODE: [Select]echo off
echo Minutes until shut down?
echo.
set /p min=Minutes:
set /a sec=%min%*60
shutdown -s -f -t %sec%



Discussion

No Comment Found