@ECHO OFF
REM (ZZZZZZTIME.BAT) TIME RUN
REM 1=iv 2=lang_system 3={REAL,TEST} 4=system 5=work
IF "%5"=="" EXIT /B
SET I_EXIT=%SYSTEMDRIVE%\I\I.%4\TMP_%3\%5.EXIT
ECHO START ZZZZZZTIME.BAT > %I_EXIT%
SET I_FRAMEWORK=D
REM SET EXE_LANG=%SYSTEMDRIVE%\I\I.%4\BIN\ITIMEW%I_FRAMEWORK%.EXE %2
SET EXE_LANG=%SYSTEMDRIVE%\I\BIN%1\ITIMEW%I_FRAMEWORK%.EXE %2
SHIFT
SHIFT
REM 1=iv 2=lang_system SHIFT(1={REAL,TEST} 2=system 3=job / 4=hh 5=mm 6=TODAY 7=/          8=(unix-queue) (9=jdbc))
REM 1=iv 2=lang_system SHIFT(1={REAL,TEST} 2=system 3=job / 4=hh 5=mm 6=NEXT  7=yyyy/mm/dd 8=(unix-queue) (9=jdbc))
REM 1=iv 2=lang_system SHIFT(1={REAL,TEST} 2=system 3=job / 4=hh 5=mm 6=job   7=option     8=client       (9=jdbc))
SET TIMEOUT_CONNECT=30&SET TIMEOUT_SQL=600
REM if "%6"=="NEXT" SET NEXT=/NEXT:%7&SET HH=99&SET MM=99&goto TIME
IF "%6"=="NEXT" SET NEXT=/SD %7&SET HH=99&SET MM=99&goto TIME
SET NEXT=&SET HH=%4&SET MM=%5
IF "%6"=="TODAY" goto TIME
START %EXE_LANG% %TIMEOUT_CONNECT% %TIMEOUT_SQL% %1 %2 %3 %4 %5 %6 %7 -%8
GOTO FIN
:TIME
REM AT %4:%5 /INTERACTIVE %NEXT% %EXE_LANG% %TIMEOUT_CONNECT% %TIMEOUT_SQL% %1 %2 %3 %HH% %MM% / AT
SET EXE=%EXE_LANG% %TIMEOUT_CONNECT% %TIMEOUT_SQL% %1 %2 %3 %HH% %MM% / AT
SCHTASKS /Delete /TN I_%1_%HH%_%MM%_%2 /F
SCHTASKS /Create /SC ONCE /RU "SYSTEM" /TN I_%1_%HH%_%MM%_%2 /TR "%EXE%" /ST %4:%5:00 %NEXT%
:FIN
ECHO !!! > %I_EXIT%
 