A opção /disable
é apenas um recurso do Vista / 7 / 2008R2 / 2012 .
Você pode simplesmente renomear o arquivo .job
da tarefa para "desativá-lo".
schtasks /Create /SC HOURLY /TN "TEST TASK" /TR notepad
schtasks
TaskName Next Run Time Status
==================================== ======================== ===============
TEST TASK 09:45:00, 7/26/2010
move "C:\WINDOWS\Tasks\TEST TASK.job" "C:\WINDOWS\Tasks\TEST TASK.bak"
schtasks
INFO: There are no scheduled tasks present in the system.
Para "ativar" a tarefa, renomeie o arquivo .bak
para .job
:
schtasks
INFO: There are no scheduled tasks present in the system.
move "C:\WINDOWS\Tasks\TEST TASK.bak" "C:\WINDOWS\Tasks\TEST TASK.job"
schtasks
TaskName Next Run Time Status
==================================== ======================== ===============
TEST TASK 09:45:00, 7/26/2010