create a time limit on a PC Batch

Hewlett-packard Pavilion dv6-2190us note...
July 14, 2011 at 16:41:08
Specs: Win 7, Core i5 / 4 gigs
i want something a little simpler than this
to create a time limit on a PC
echo off
cls
::shutdown protocol beta
mode 80, 2
:loop
set /p call=<time.dll
echo %call%
timeout /t 1 >nul
cls

set h=hours
set m=minutes
time /t > time.dll
set /p time=<time.dll
if "%time%" GEQ "12:00 PM" echo approx. 21 %h% 00 %m% until shutdown >time.dll
if "%time%" GEQ "12:10 PM" echo approx. 21 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "12:20 PM" echo approx. 21 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "12:30 PM" echo approx. 21 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "12:40 PM" echo approx. 21 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "12:50 PM" echo approx. 21 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "01:10 PM" echo approx. 20 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "01:20 PM" echo approx. 20 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "01:30 PM" echo approx. 20 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "01:40 PM" echo approx. 20 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "01:50 PM" echo approx. 20 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "02:10 PM" echo approx. 19 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "02:20 PM" echo approx. 19 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "02:30 PM" echo approx. 19 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "02:40 PM" echo approx. 19 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "02:50 PM" echo approx. 19 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "03:10 PM" echo approx. 18 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "03:20 PM" echo approx. 18 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "03:30 PM" echo approx. 18 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "03:40 PM" echo approx. 18 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "03:50 PM" echo approx. 18 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "04:10 PM" echo approx. 17 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "04:20 PM" echo approx. 17 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "04:30 PM" echo approx. 17 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "04:40 PM" echo approx. 17 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "04:50 PM" echo approx. 17 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "05:10 PM" echo approx. 16 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "05:20 PM" echo approx. 16 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "05:30 PM" echo approx. 16 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "05:40 PM" echo approx. 16 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "05:50 PM" echo approx. 16 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "06:10 PM" echo approx. 15 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "06:20 PM" echo approx. 15 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "06:30 PM" echo approx. 15 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "06:40 PM" echo approx. 15 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "06:50 PM" echo approx. 15 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "07:10 PM" echo approx. 14 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "07:20 PM" echo approx. 14 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "07:30 PM" echo approx. 14 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "07:40 PM" echo approx. 14 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "07:50 PM" echo approx. 14 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "08:10 PM" echo approx. 13 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "08:20 PM" echo approx. 13 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "08:30 PM" echo approx. 13 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "08:40 PM" echo approx. 13 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "08:50 PM" echo approx. 13 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "09:10 PM" echo approx. 12 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "09:20 PM" echo approx. 12 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "09:30 PM" echo approx. 12 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "09:40 PM" echo approx. 12 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "09:50 PM" echo approx. 12 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "010:10 PM" echo approx. 11 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "010:20 PM" echo approx. 11 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "010:30 PM" echo approx. 11 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "010:40 PM" echo approx. 11 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "010:50 PM" echo approx. 11 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "011:10 PM" echo approx. 10 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "011:20 PM" echo approx. 10 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "011:30 PM" echo approx. 10 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "011:40 PM" echo approx. 10 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "011:50 PM" echo approx. 10 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "12:10 PM" echo approx. 9 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "12:20 PM" echo approx. 9 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "12:30 PM" echo approx. 9 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "12:40 PM" echo approx. 9 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "12:50 PM" echo approx. 9 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "01:10 PM" echo approx. 8 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "01:20 PM" echo approx. 8 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "01:30 PM" echo approx. 8 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "01:40 PM" echo approx. 8 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "01:50 PM" echo approx. 8 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "02:10 PM" echo approx. 7 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "02:20 PM" echo approx. 7 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "02:30 PM" echo approx. 7 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "02:40 PM" echo approx. 7 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "02:50 PM" echo approx. 7 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "03:10 PM" echo approx. 6 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "03:20 PM" echo approx. 6 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "03:30 PM" echo approx. 6 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "03:40 PM" echo approx. 6 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "03:50 PM" echo approx. 6 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "04:10 PM" echo approx. 5 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "04:20 PM" echo approx. 5 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "04:30 PM" echo approx. 5 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "04:40 PM" echo approx. 5 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "04:50 PM" echo approx. 5 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "05:10 PM" echo approx. 4 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "05:20 PM" echo approx. 4 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "05:30 PM" echo approx. 4 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "05:40 PM" echo approx. 4 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "05:50 PM" echo approx. 4 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "06:10 PM" echo approx. 3 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "06:20 PM" echo approx. 3 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "06:30 PM" echo approx. 3 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "06:40 PM" echo approx. 3 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "06:50 PM" echo approx. 3 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "07:10 PM" echo approx. 2 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "07:20 PM" echo approx. 2 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "07:30 PM" echo approx. 2 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "07:40 PM" echo approx. 2 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "07:50 PM" echo approx. 2 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "08:10 PM" echo approx. 1 hour 50 %m% until shutdown >time.dll
if "%time%" GEQ "08:20 PM" echo approx. 1 hour 40 %m% until shutdown >time.dll
if "%time%" GEQ "08:30 PM" echo approx. 1 hour 30 %m% until shutdown >time.dll
if "%time%" GEQ "08:40 PM" echo approx. 1 hour 20 %m% until shutdown >time.dll
if "%time%" GEQ "08:50 PM" echo approx. 1 hour 10 %m% until shutdown >time.dll
if "%time%" GEQ "09:00 PM" echo approx. 1 hour 00 %m% until shutdown >time.dll
if "%time%" GEQ "09:10 PM" echo approx. 0 %h% 50 %m% until shutdown >time.dll
if "%time%" GEQ "09:20 PM" echo approx. 0 %h% 40 %m% until shutdown >time.dll
if "%time%" GEQ "09:30 PM" echo approx. 0 %h% 30 %m% until shutdown >time.dll
if "%time%" GEQ "09:40 PM" echo approx. 0 %h% 20 %m% until shutdown >time.dll
if "%time%" GEQ "09:50 PM" echo approx. 0 %h% 10 %m% until shutdown >time.dll
if "%time%" GEQ "09:51 PM" echo approx. 9 %m% until shutdown >time.dll
if "%time%" GEQ "09:52 PM" echo approx. 8 %m% until shutdown >time.dll
if "%time%" GEQ "09:53 PM" echo approx. 7 %m% until shutdown >time.dll
if "%time%" GEQ "09:54 PM" echo approx. 6 %m% until shutdown >time.dll
if "%time%" GEQ "09:55 PM" echo approx. 5 %m% until shutdown >time.dll
if "%time%" GEQ "09:56 PM" echo approx. 4 %m% until shutdown >time.dll
if "%time%" GEQ "09:57 PM" echo approx. 3 %m% until shutdown >time.dll
if "%time%" GEQ "09:58 PM" echo approx. 2 %m% until shutdown >time.dll
if "%time%" GEQ "09:59 PM" echo approx. 1 %m% until shutdown >time.dll

goto loop


See More: create a time limit on a PC Batch

Report •

#1
August 17, 2011 at 09:50:19
found it... because no one answered it. a little hunting found a code that worked.

@echo off
:loop
cls

set h=%TIME:~0,2%
set m=%TIME:~3,2%
set t2=%h%:%m%
echo current time: %t2%

set /a ct=22-%h%
set /a ct2=60-%m%

echo %ct% hours and %ct2% minutes until shutdown

if %h%==22 shutdown /s
timeout /t 5 >nul
goto loop


Report •
Related Solutions


Ask Question