1

Is there a way to create windows scheduled task that is run periodically to check for another task, and if found, then delete said task and continue checking for that task in case it appears again?

loa_in_
  • 1,030
  • 9
  • 20

1 Answers1

0

You can write a batch script, and schedule it to run.

The command line to delete a task by name is:

schtasks /delete /tn <task name> /f

The command line to list all tasks with details in CSV is:

schtasks /query /v /fo LIST > file.csv

though schtasks /query gives a bit of information too, especially names.

Sources:

loa_in_
  • 1,030
  • 9
  • 20
  • Perfect, thank you very much for this. Seems to work, now I just need to ensure task runs as administrator.. Cheers! –  Aug 24 '18 at 11:16