giving "access denied" error for a .bat file

  • Platform: SQL Server 2008 running on Windows Server 2008

    Scenario: I am calling a simple batch file (D:\test.bat) that renames a file from within a SQL Server job (Test), the job fails with an “Access denied” error.

    •The job owner is set to SA, and the job is running under the SQL Server Agent service account (say domain\serviceaccount)

    •This domain\serviceaccount account has local admin rights on the server hence ideally there shouldn’t be any permission issues.

    •The SQL job also runs fine if we add the service account to the “Users” group on the windows server.

    This seems counter intuitive since Local Administrator group has the highest level of rights.

    The exact error message is “Executed as user: domain\serviceaccount. C:\WINDOWS\system32>REN D:\Test.dat test2.dat Access is denied. Process Exit Code 1. The step failed.

    any one suggest,whats the actual problem???

  • any solutions? im running into the same issue as well..

  • Is the file open in some other application that's got an exclusive lock on it?

  • Double check the ntfs permissions that are set on the file and the directory where the file is stored.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply