**We are currently moving to a new host. Please pardon any errors!**
Scheduled Tasks involving BAT files and Windows Server 2003/Win XP | Debugge
 

Scheduled Tasks involving BAT files and Windows Server 2003/Win XP

Recently, I had issues running a scheduled task as a generic user. The contents of the BAT file aren’t important, but the error is.
“XXXXX.job” (XXXXX.bat) **ERROR**
0×80070005: Access is denied.
Try using the Task page Browse button to locate application.

The solution was so obvious that I wanted to kick myself. Scroll down if you have already checked the most obvious things. For those of you that want to be thorough with your solution. Here’s the things you need to check:

Rights:

  1. Click Start
  2. Click Run
  3. Type: secpol.msc /s and hit OK
  4. Under Local Policies -> User Rights Assignment you will see the following policies. Make sure your scheduled task user is in there:
    • Log on as a batch job

Location of Script:
If it’s a network drive, ensure you are using the UNC. What is UNC you ask? \SERVERNAME – Try running that in Start->Run and see if you can pull your network server up. Go from there.

Permissions:
Check that the scheduled task user has Execute permissions on the BAT file you want to run

Finally, if you’ve done all of that and you are still having trouble. Here comes the solution. I found this article at support.microsoft.com and I wanted to kick myself. The issue is the permissions on CMD. Here’s all you need to do:

  1. Click Start
  2. Click Run
  3. Type: %windir%
  4. In the window that opens browse to SYSTEM32
  5. Browse to CMD
  6. Right click and view the properties
  7. Add your user to the permissions with Read/Execute at least

Try it again. If you have trouble post here, and I’ll help out.

I hope that helps someone out there.

Author:  Crimm

Software engineer (PHP, Bat, VBS), Sr. Systems Admin, Techie, Father, Gamer, Anime watcher (Wannabe Otaku), & full of geek!