| :VisualSet |
| @echo off |
| echo X=%~2>>VisualSet.vbs |
| echo wscript.echo(X)>>VisualSet.vbs |
| for /f %%a in ('cscript //nologo VisualSet.vbs') do set %1=%%a |
| if exist VisualSet.vbs del VisualSet.vbs |
| goto :eof |
| |
| :Echo_Debugging |
| mode con cols=68 lines=34 |
| cls |
| echo. |
| echo. Hope计时器[调试程序] |
| set /p Str=--------------------------------------------------------------------<nul |
| echo. |
| echo. |
| @goto :eof |
| |
| :Task |
| mode con cols=68 lines=34 |
| Md Tasks >nul 2>nul |
| cls |
| title Hope计时器[计划程序] |
| set Error=0 |
| echo. |
| echo. Hope计时器[计划程序] |
| set /p Str=--------------------------------------------------------------------<nul |
| echo. |
| echo. |
| echo. ^>^> Q 新建计划 W 使用计划 D 删除计划 E 返回菜单 R 退出 |
| if not exist Tasks\*.Htd ( |
| echo. |
| echo. ^>^> 当前没有计划 |
| set /p Str=--------------------------------------------------------------------<nul |
| echo. |
| echo. |
| ) |
| if not exist Tasks\Htd.Hdat echo.10000 > Tasks\Htd.Hdat |
| if exist Tasks\*.Htd ( |
| cd Tasks |
| echo. |
| echo. ^>^> 当前计划列表 |
| set /p Str=--------------------------------------------------------------------<nul |
| echo. |
| echo. |
| for /f %%i in ('dir /b *.Htd') do ( |
| for /f "skip=5" %%j in (%%~ni.Htd) do echo. ^>^> 编号:%%~ni 备注:%%j |
| ) |
| echo. |
| cd.. |
| ) |
| ) |
| call :get_key |
| if /i "!key!"=="E" ( |
| @goto :Main |
| ) |
| if /i "!key!"=="D" ( |
| @goto :Del |
| ) |
| if /i "!key!"=="R" ( |
| del sleep.com sleep.exe sleep.vbs |
| exit |
| ) |
| if /i "!key!"=="Q" ( |
| @goto :New |
| ) |
| if /i "!key!"=="W" ( |
| @goto :Open |
| ) |
| if /i "!valid_key!" equ "0" @goto :Task |
| |
| :Open |
| if exist Tasks\*.Htd ( |
| set "Content= " |
| set /p Content= ^>^> 请输入计划编号: |
| goto Open_2 |
| ) else cd..&@goto :Task |
| |
| :Del |
| if exist Tasks\*.Htd ( |
| set "Content= " |
| set /p Content= ^>^> 请输入计划编号: |
| goto Del_2 |
| ) else cd..&@goto :Task |
| |
| :Del_2 |
| cd Tasks |
| if exist %Content%.Htd ( |
| del %Content%.Htd |
| cd.. |
| goto Task |
| ) else cd..&goto Task |
| |
| :Open_2 |
| cd Tasks |
| if exist %Content%.Htd ( |
| call :Read %Content% |
| cd.. |
| mode con cols=68 lines=5 |
| @goto :Start |
| ) else cd..&goto Task |
| |
| :New |
| cd Tasks |
| < Htd.Hdat ( |
| set /p Num= |
| ) |
| set /a Num+=1 |
| echo.%Num% > Htd.Hdat |
| cd.. |
| echo. |
| echo. ^>^> 新建计划:%Num% |
| echo. |
| set "Content=时间到!!!" |
| set /p Content= ^>^> 备注: |
| echo. |
| set "Content=%Content:>=^>%" |
| set "Content=%Content:<=^<%" |
| set "Content=%Content:|=^|%" |
| set "Title= " |
| set /p Title= ^>^> 到时提醒: |
| echo. |
| set "Title=%Title:>=^^^>%" |
| set "Title=%Title:<=^^^<%" |
| set "Title=%Title:|=^^^|%" |
| set H=0 |
| set Min=0 |
| set S=0 |
| set H_2=0 |
| set Min_2=0 |
| set S_2=0 |
| set Ms=0 |
| set Ms_2=0 |
| call :Vbs_Sleep 1000 |
| @goto :New_2 |
| |
| :Read |
| < %1.Htd ( |
| set /p H= |
| set /p Min= |
| set /p S= |
| set /p Ms_2= |
| set /p Title= |
| set /p Content= |
| ) |
| @goto :eof |
| |
| :New_2 |
| cls |
| echo. |
| echo. ^>^> 当前计时时间:%H%小时%Min%分钟%S%秒 |
| echo. |
| echo. Q/W 小时加/减 E/R 分钟加/减 T/Y 秒加/减 U 完成计划 |
| echo. |
| call :get_key |
| call :Settings_Time |
| if /i "!key!"=="U" ( |
| ( |
| echo.%H% |
| echo.%Min% |
| echo.%S% |
| echo.%Ms_2% |
| echo.%Title% |
| echo.%Content% |
| ) > Tasks\%Num%.Htd |
| @goto :Task |
| ) |
| if /i "!valid_key!" equ "0" @goto :New_2 |
| |
| :Error |
| color 1f |
| cls |
| echo. |
| echo. ^>^> Sleep.exe 和 Sleep.com 不知到何处去了... |
| echo. |
| echo. ^>^> 正在帮您恢复 |
| call :Sleep_Installs |
| goto :Restart |
| :Start |
| set Error=0 |
| cls |
| title 计时器[%H_2%小时%Min_2%分钟%S_2%秒/%H%小时%Min%分钟%S%秒] |
| echo. |
| echo. ^>^> %H_2%小时%Min_2%分钟%S_2%秒%Ms%毫秒/%H%小时%Min%分钟%S%秒 |
| echo. |
| echo. ^>^> Ctrl+C暂停或退出... |
| call :Sleep %Time% |
| if %Error%==1 goto :Error |
| set /a Ms+=100 |
| if %Ms%==1000 set /a S_2+=1&set Ms=0 |
| if %S_2% Geq 60 set /a Min_2+=1&set S_2=0 |
| if %Min_2% Geq 60 set /a H_2+=1&set Min_2=0 |
| if %H_2% Geq %H% if %Min_2% Geq %Min% if %S_2% Geq %S% goto :End |
| if /i "!valid_key!" equ "0" goto :Start |
| |
| :End |
| cls |
| color 4e |
| title 计时器[%H_2%小时%Min_2%分钟%S_2%秒/%H%小时%Min%分钟%S%秒] |
| Call :Msg "%Title%" vbExclamation "Hope计时器" |
| color 0f |
| @call :Restart |
| @goto :Main |
| |
| :Vbs_Sleep |
| echo.Wscript.Sleep %1 > Sleep.vbs |
| call Sleep.vbs > nul |
| if exist ReturnKey.vbs del ReturnKey.vbs |
| @goto :eof |
| |
| :Sleep_Installs |
| color 0f |
| ( |
| echo.-----BEGIN CERTIFICATE----- |
| echo.TVpQAQEAAAAEAAAA//8AAFABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
| echo.AAAAAAAAAAAAAAAAkAAAAPy+gQAPtkz/ZjHSZjHASXggrCwwchQ8CXcQZmvSCmYB |
| echo.wi7HBi8AMQDr5C7/Ji8ADgBmadLoAwAAZonRZsHpELSGzRW4AEzNIQAAAAAAAAAA |
| echo.UEUAAEwBAQBQeaU2AAAAAAAAAADgAA8BCwEFDAACAAAAA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AAAAAAAAAAAAAAAAAAAAAAA |
| echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
| echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
| echo.AAAAAAAAAAAAAAAAAAAAAA== |
| echo.-----END CERTIFICATE----- |
| ) > Sleep.com |
| Certutil -Decode Sleep.com Sleep.exe > nul |
| Certutil -Decode -f Sleep.com Sleep.com > nul |
| goto :eof |
| |
| :Sleep |
| set Error=0 |
| if exist Sleep.exe ( |
| Sleep.exe %1 |
| goto :eof |
| ) |
| if not exist Sleep.exe if exist Sleep.com ( |
| Sleep.com %1 |
| goto :eof |
| ) |
| if not exist Sleep.exe if not exist Sleep.com ( |
| set Error=1 |
| goto :eof |
| ) |
| |
| :get_key |
| |
| set "key=" |
| for /f "delims=" %%a in ('xcopy /w "%~f0" "%~f0" 2^>nul') do if not defined key set "key=%%a" |
| set "key=%key:~-1%" |
| set "valid_key=0" |
| goto :eof |
| |
| :Msg |
| |
| echo.Msg=msgbox("%~1",%2,"%~3") > ReturnKey.vbs |
| Call ReturnKey.vbs > nul |
| if exist ReturnKey.vbs del ReturnKey.vbs |
| goto :eof |
| |
| :Settings_Time |
| if %Ms_2% Leq 200000000 if %H% geq 0 if %Min% Geq 0 if %S% Geq 0 ( |
| if /i "!key!"=="q" ( |
| set /a Ms_2+=3600000 |
| set /a H+=1 |
| ) |
| if /i "!key!"=="w" ( |
| set /a Ms_2-=3600000 |
| set /a H-=1 |
| ) |
| if /i "!key!"=="e" ( |
| set /a Ms_2+=60000 |
| set /a Min+=1 |
| ) |
| if /i "!key!"=="r" ( |
| set /a Ms_2-=60000 |
| set /a Min-=1 |
| ) |
| if /i "!key!"=="t" ( |
| set /a Ms_2+=1000 |
| set /a S+=1 |
| ) |
| if /i "!key!"=="y" ( |
| set /a Ms_2-=1000 |
| set /a S-=1 |
| ) |
| ) |
| if %S% Lss 0 ( |
| if %Min% Geq 0 if %H% Geq 0 ( |
| set /a Min-=1&set /a S+=60 |
| ) |
| if %Min% Leq 0 if %H% Leq 0 ( |
| echo. |
| echo. ^>^> 算数错误! |
| call :Vbs_Sleep 100 |
| @call :Restart |
| ) |
| ) |
| if %Min% Lss 0 ( |
| if %H% Gtr 0 set /a H-=1&set /a Min+=60 |
| if %H% Leq 0 ( |
| echo. |
| echo. ^>^> 算数错误! |
| call :Vbs_Sleep 100 |
| @call :Restart |
| ) |
| ) |
| if %H% Lss 0 ( |
| echo. |
| echo. ^>^> 算数错误! |
| call :Vbs_Sleep 100 |
| @call :Restart |
| ) |
| if %Ms_2% Gtr 200000000 ( |
| echo. |
| echo. ^>^> 算数错误! |
| call :Vbs_Sleep 100 |
| @call :Restart |
| ) |
| if %S% Geq 60 set /a Min+=1&set S=0 |
| if %Min% Geq 60 set /a H+=1&set Min=0COPY |