[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 10498
  • Last Modified:

scheduled tasks registry settings

i want to enable or disbale a scheduled task using registry keys.  How can i do this.
0
ServiceOps
Asked:
ServiceOps
  • 2
  • 2
1 Solution
 
hlarseCommented:
Hi ServiceOps,

Task definitions and schedules are actually stored in a binary .job file, located in c:\windows\tasks.  Since this is the case, it is not possible to edit the registry to enable/disable a task.

Have you tried the schtask command?  Take a look at http://msdn2.microsoft.com/en-us/library/bb736357(VS.85).aspx, specifically the /change section.
0
 
souseranCommented:
Task Scheduler options are stored in the registry

HKLM\SOFTWARE\Microsoft\SchedulingAgent\
0
 
souseranCommented:
However, hlarse is correct that the task *definitions* are not.
0
 
ServiceOpsAuthor Commented:
souseran

i guess "enabling the task" is part of the "definitions" because i can't see that in the registry
0
 
hlarseCommented:
ServiceOps

You can get around this by running the following commands:
to enable - schtasks /change /TN taskname /ENABLE
to disable - schtasks /change /TN taskname /DISABLE

Is there a particular reason that this must be a registry edit?
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now