Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Determined the time, added 5 minutes, scheduled the launch via schtasks
schtasks /tn "NameTask" /delete
set /A start_h=%time:~0.2%
set /A start_m=%time:~3.2%
set /A start_s=%time:~6.2%
rem We assume that we fit in hours and minutes
set end_h=%start_h%
set end_m=%start_m%
rem Add seconds
set /A end_s=%start_s%+300
rem -whether in 60 seconds and 60 minutes
if %end_s% GTR 60 set /A end_m=%start_m%+%end_s%/60&&set /A end_s=%start_s%+(%1-%1/60)
if %end_m% GTR 60 set /A end_h=%start_h%+%end_m%/60&&set /A end_m=%start_m%+(%end_m%-%end_m%/60)
if %end_h% lss 10 schtasks /tn "NameTask" /create /U User /P password /TR "executable file" /SC once /ST 0%end_h%:%end_m%:00
schtasks /tn "comuchet" /create / U User /P password /TR "executable file" /SC once /ST %end_h%:%end_m%:00
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question