Scheduled Task gets removed upon reboot

552 Views Asked by At

I'm trying to make a scheduled task for a small software I had written for a friend, I'm using Schtasks /create /SC MINUTE /MO 30 /tn JoesInventoryReader /tr C:\joes.exe /RL HIGHEST But for some reason, whenever we reboot the computer, this task is removed. I was reading all of Schtasks parameters and none mentioned anything related to automatic removal.

Help? I've been trying to fix that for over an hour. Thanks in advance everyone

1

There are 1 best solutions below

3
On BEST ANSWER

Your task is triggered once and then runs repeatedly.

If you want to execute the program regularly, you should use /SC DAILY (or weekly, monthly) or /SC ONLOGON.

Use /RI to define the repetition and /DU to define the length of the repetition:

Schtasks /create /SC DAILY /RI 30 /DU 24:00 /tn JoesInventoryReader /tr C:\joes.exe /RL HIGHEST