windows下批处理实现交易时间判断

@set hour=%time:~0,2%
@set min=%time:~3,2%
echo %hour%:%min%
@if %hour% lss 15 @if %hour% gtr 9 echo jysj

 

 

@echo off
rem 取得当前时分值
set currentTime=%time:~0,2%%time:~3,2%

rem 判断当前时分值是否为开市时间
if %currentTime% leq 830 (goto notRun) else ( if %currentTime% leq 1130 (goto runIt) else ( if %currentTime% leq 1330 (goto notRun) else ( if %currentTime% leq 1600 (goto runIt) else (goto notRun) ) ) )

:runIt
start "" "c:\windows\system32\notepad.exe"
exit

:notRun
exit

你可能感兴趣的:(职场,休闲,交易时间)