Disable all tasks in folder

OSVBNET 1,401 Reputation points
2022-05-25T14:10:26.417+00:00

Hello, any idea how to disable all tasks inside a folder?

SchTasks /Change /TN "\FolderBlah*" /Disable

Why does not work :(

Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | VB
0 comments No comments
{count} votes

Answer accepted by question author
  1. Michael Taylor 61,181 Reputation points
    2022-05-25T14:39:14.06+00:00

    schtasks doesn't allow tasks with wildcards AFAIK. You cannot disable an entire folder of tasks that way.

    Option 1 is to first get all the tasks in the task path and then enumerate them one by one and call the command.

    Option 2 is to use Powershell (PS 5+) that has cmdlets that can do this.

    Get-ScheduledTask -TaskPath "\FolderBlah\" | Disable-ScheduledTask
    

    Note that task paths must start and end with a slash.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.