Windows Schedule Task 0x80070005: Access is denied

When you setting up a scheduled task from your Windows Server 2003, sometimes you might find out the error as below.

Error 0x80070005: Access is denied.

You might wonder what wrong with your scheduled task and how to fix it, basically this error caused by the Windows permission of the batch file you run from scheduled task.

To get this fix, actually you have 2 options.

Option 1:
1. Open Windows Explorer, from the Address bar, type in “%windir%\System32”.
2. Look for cmd.exe, right-click and go to properties.
3. Click on Security tab and add the user you are using to set the scheduled task, then grant read and write permission to these user.

Option 2:
1. Open Windows Explorer, from the Address bar, type in “%windir%\System32”.
2. Look for cmd.exe, right-click and go to properties.
3. Click on Security tab and add user name “BATCH”, then grant read and write permission to this user.

Scheduled Task for .aspx (ASP.Net) file

Normally you may set the scheduled task easily by calling the program or script that you are using/coded, however if you come with the ASP.Net script, are you able to call through the asp dll library directly?

The answer is exactly no, as you may either use your Internet Browser to call your asp.net script, but your browser is going to open 1 session for each of your scheduled task ran.

With this article, Mick Genie will guide to use VBS script to call HTTP request to call your ASP.Net script.

1. First, create a .bat file from your notepad, insert cscript mickgenie.vbs and save it as mickgenie.bat.
2. Open another notepad and insert the line as below.
Call Send_HTTP_Request()
Sub Send_HTTP_Request()
On Error Resume Next
Dim objRequest
Dim URL
Set objRequest = CreateObject(“Microsoft.XMLHTTP”)
URL = “http://www.mickgenie.com/mickgenie.aspx” //replace your URL HERE
objRequest.open “POST”, URL , false
objRequest.Send
Set objRequest = Nothing
End Sub

3. Set the scheduled task from your box and test it.
4. There do not have step 4 🙂 .