unable to schedule a task (access denied)

Solution 1:

OK Guys, this issue plagued me for some time. I finally found a solution and would like to share.

Warning! The following solution involves the Windows System Registry. Editing or manipulating the registry incorrectly can result in serious system damage which may require reinstallation of the operating system. If you are not comfortable editing the registry, then take your system to a professional. If you choose to proceed, then it is essential that you create a complete system backup and a Windows System Restore Point before proceeding.

First download subinacl from Microsofts web site and run the installation package. http://www.microsoft.com/downloads/details.aspx?FamilyID=E8BA3E56-D8FE-4A91-93CF-ED6985E3927B&displaylang=en

SubInACL is a command-line tool that enables administrators to obtain security information about files, registry keys, and services, and transfer this information from user to user, from local or global group to group, and from domain to domain.

Next copy and paste the following command to a text file. Save the file as reset.cmd. Once saved double click the file and the commands will begin to run. This process takes anywhere from 3 to 10 minutes of time. After it has run, there will be no restart required in most cases(Oracle I found to be a different story). Proceed with scheduling task or whatever you were doing before getting the dreaded "Access Denied" Error. Hope this helps!

cd /d "%ProgramFiles%\Windows Resource Kits\Tools"
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f
subinacl /subdirectories %SystemDrive% /grant=administrators=f /grant=system=f
subinacl /subdirectories %windir%\*.* /grant=administrators=f /grant=system=f
secedit /configure /cfg %windir%\repair\secsetup.inf /db secsetup.sdb /verbose

Solution 2:

There is a much simpler way if it has to do with permissions on the task directory. This directory is protected, so you must use a resource kit tool to make changes to its permissions.

First install subinacl (you have to get this from Microsoft)

Then run these three commands from a cmd prompt and root of your c: drive.

cd\
cacls c:\windows\tasks /T /E /P Administrators:F
cacls c:\windows\tasks /T /E /P SYSTEM:F

These commands will grant full permissions to the tasks folder for the user group Administrators and the user System.

Solution 3:

Resolved for me - Same issue in Windows Server 2008 Standard Edition SP2. Debugging the Scheduled Task provided the info "Error 5 Access is denied"

Resolved by checking "Run with highest privileges" on General tab of scheduled task properties