Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 如何在批处理文件中添加日期条件_Batch File_Cmd_Scheduled Tasks - Fatal编程技术网

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

Batch file 如何在批处理文件中添加日期条件,batch-file,cmd,scheduled-tasks,Batch File,Cmd,Scheduled Tasks,我的启动文件夹中有一个批处理文件。如何在批处理文件中添加一个条件,使其仅在系统日期介于当月的第5-25日之间且日期为上午6-11时执行命令。 我无法将任务计划程序用于此任务 提前谢谢 @echo关闭 @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') d

我的启动文件夹中有一个批处理文件。如何在批处理文件中添加一个条件,使其仅在系统日期介于当月的第5-25日之间且日期为上午6-11时执行命令。
我无法将任务计划程序用于此任务

提前谢谢

@echo关闭
@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
)
pushd“%temp%” makecab/D RptFileName=~.rpt/D InfFileName=~.inf/f nul>nul
对于('find/i“makecab”^中的/f“tokens=3-7”%%a,到目前为止没有任何效果