Is there a way to delete a scheduled task if you only know the filename of the application the task will run

I need to delete a scheduled task on a large number of machines preferably using only the command line. The problem is that the tasks were manually added on every computer, so the name of the task is not consistent between each one. I was hoping I could delete the task using the name of the exe file that the task runs, but this does not appear to be an option of the schtasks command.

I thought I was making progress using this command, but its not returning the name of the task for it to then be deleted.

for /f "tokens=3 delims=\" %%x in ('schtasks /query /fo:list ^| findstr ^^PrintTask.exe') do schtasks /Delete /TN "%%x" /F


from Recent Questions - Stack Overflow https://ift.tt/3ztBWLA
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation