set sj=%time:~0,2%%time:~3,2%
if %sj%>1145 (if %sj%<1245 shutdown -s -t 10)
if %sj%>1145 (if %sj%<1245 shutdown -s -t 10)
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!
Originally posted by lotus516 at 2009-2-8 06:18 PM:
set sj=%time:~0,2%%time:~3,2%
if %sj%>1145 (if %sj%<1245 shutdown -s -t 10)
Originally posted by jmzhwf at 2009-2-7 03:39 PM:
Oh~~~~Sorry~I read the question wrong and reversed the BAT~~hehe
@echo off
if %time% gtr 11:45:00.00 if %time% lss 12:40:00.00 shutdown -s -t 0 -f
if %time% gtr 17:00:00.00 if %time% lss 19:00:00.00 s ...
@echo off&setlocal enabledelayedexpansion
(set str=xxxxxxxaxxxaaxxxxaaaaaaaxx
rem x is the restricted time, a is the open time, in hours, starting from 0 hour
set g=!str:~%time:~,2%,1!
for /l %%a in (%time:~,2%,1,25) do if "!str:~%%a,1!" equ "!g!" (set gg=0%%a) else (goto :ok)
)
:ok
(
if !g! neq x (
echo;y|schtasks /delete /tn "%~1"
echo;a|schtasks /Create /tn "Learning Plan" /tr "%~f0 Learning Plan" /ru "Username" /rp "Password" /sc minute /mo 5 /st %gg:~-2%:55:00 /ed 2010/06/30
rem Expiration date: 2010/06/30
del /q %temp%\close.ben
goto :eof)
if exist %temp%\close.ben (
Shutdown.exe -s -t 1
echo;a|schtasks /create /tn "Startup Run" /tr "%~f0 Startup Run" /ru "Username" /rp "Password" /sc onstart
goto :eof)
)1>nul 2>nul
(
mode con cols=30 lines=6
echo;>%temp%\close.ben
echo; Ensure sufficient sleep!
echo; Study hard and make progress every day!
echo; Save quickly, shut down in five minutes!
ping -n 5 127.1 1>nul
goto :eof
)
:granf