如何在批处理文件中添加日期条件

How to add date condition in batch file

我的启动文件夹中有一个批处理文件。如何在批处理文件中添加一个条件,如果系统日期在当月的 5 日到 25 日之间并且日期是上午 6 点到 11 点,则只执行命令。
我无法为此任务使用任务计划程序。

提前致谢!

@echo off
pushd "%temp%"
makecab /D RptFileName=~.rpt /D InfFileName=~.inf /f nul >nul
for /f "tokens=3-7" %%a in ('find /i "makecab"^<~.rpt') do (
   set "current-date=%%e-%%b-%%c"
   set "current-time=%%d"
   set "weekday=%%a"
)
del ~.*
popd
rem echo %current-time%
for /f "tokens=1,2,3 delims=-" %%a in ("%current-date% ") do (
    set year=%%a
    set mon=%%b
    set day=%%c
)
echo %day%

for /f "tokens=1,2,3 delims=:" %%a in ("%current-time% ") do (
    set hh=%%a
    set mm=%%b
    set ss=%%c
)

echo %hh%

if %day% LEQ 25  if %day% GEQ 5 if %hh% LEQ 11 if %hh% GEQ 6 (
    echo execute my thing
)