You can not really create (and recreate) tasks by command line in Windows XP.
The solution I came up with was to create a number of triggers in a single task which is quite annoying, so I would prefer a BAT to do it.
I've enabled checkbox
option Show multiple schedules :
SoIcouldhaveaccesstothe'New'buttonwhichincludesarepeatertriggeridenticaltothepreviousone,butwithanextrahour:
WhenIcreatedoneforeachtime(standard24hours),from00:00to23:00
Thenwhenthesystemstarts(rememberthatalltriggersstartwithoutuserauthentication,ieonlyafterLOGON).
TocompleteIcopiedthefile*.JOB
fromtheTASKSfoldertothefolderofmyapplication.
copy%windir%\tasks\mystask.job%homedrive%\myapp\
@ECHOOFF:STARTAPPIFEXIST%windir%\tasks\mystask.job(SETABKP=ON)ELSE(SETABKP=OFF)CLSECHO[1]Menu1ECHO[2]Menu2ECHO[3]AtivaroudesativarAUTOBACKUP:%ABKP%ECHO[4]Menu4ECHO.SET/PSLT=Selecioneumdositensacima:IF"%SLT%"=="1" (GOTO OPTION1)
IF "%SLT%"=="2" (GOTO OPTION2)
IF "%SLT%"=="3" (GOTO OPTION3)
IF "%SLT%"=="4" (GOTO OPTION2)
:OPTION3
IF EXIST %windir%\tasks\mystask.job (
COPY %HOMEDRIVE%\myapp\mytask.job %windir%\tasks\
) ELSE (
DEL %windir%\tasks\mystask.job
)
GOTO STARTAPP
And the best, as it only works after the user "logged in" then regardless of the machine I put or the user running it when the *.JOB
file is copied to TASKS folder and you check the properties it automatically changes the user to what is running, ensuring that it will work as it does not ask for authentication.