Resolve Error Message 0x80070005 Access Is Denied

On a Windows XP computer, if you try to use the Task Scheduler to schedule a task after installing the security update 841873, the following error message may be displayed on the screen:

Error Message: 0x80070005: Access is denied

Resolution Method

This is a known error and Microsoft has released a hotfix to fix the problem. You can request this hotfix at the following Microsoft Web site.

The hotfix is intended only to fix the problem that is described in this article. Microsoft recommends that if the problem is not that serious, you should wait for the next service pack for the Windows Operating System that will contain the hotfix.

On a Windows 2003 computer when you try to run a batch job under the context of a regular user account the script may fail to run. Additionally, if you try to use the Scheduled Task feature to run the batch job, you may find the following error message logged in the Schedule Tasks (Schedlgu.txt) log file.

Error Message: 0x80070005: Access is denied.

Also, if you attempt to use a debugger program to find the reason behind the failure of the batch job, you may receive the following debug output:

Access Denied (Error 5)

Cause of the Error

On a Windows 2003 server, you encounter this error message when all of the following conditions are true:

  • The batch job is run on a Windows 2003 member server.
  • The batch job is run as a non-interactive job.
  • The batch job is run in the context of a user account that is not added as a member of the Administrator group.

The batch job is run using the Command Prompt (CMD.exe) window. The Users group does not have Read and Execute permissions on the CMD.exe. On a Windows 2003 computer, CMD.exe has the following permissions:

  • Interactive implicit group: Read and Execute
  • Service implicit group: Read and Execute
  • Administrators group: Full Control permissions
  • System implicit group: Full Control permissions

Resolution Methods

You can resolve the issue by using one of the following methods:

Method 1

Grant Read and Execute permissions for the CMD.exe program to the user account under which you are running the batch job by performing the following steps:

  1. Open Windows Explorer.
  2. Open the %windir%\System32 folder.
  3. Locate the CMD.exe file and then right-click on it.
  4. Select the Properties command, open the Security tab, and then click the Add button.
  5. Next, in the Enter the object names to select box, type the name of the user under which you are trying to run the batch job, and then click the OK button twice.
  6. This action will automatically grant Read and Execute permissions to the user.

  7. When prompted, click Yes to continue.

Method 2

Grant Read and Execute permissions for the CMD.exe program to the batch group by performing the following steps:

  1. Open Windows Explorer.
  2. Open the %windir%\System32 folder.
  3. Locate the CMD.exe file and then right-click on it.
  4. Select the Properties command, open the Security tab, and then click the Add button.
  5. Next, in the Enter the object names to select box, type Batch, and then click the OK button twice.
  6. When prompted, click Yes to continue.