I am trying to execute a batch file from SQL Server Agent (as it needs to be done before some SSIS-packages are run). When I execute the job it fails in a few seconds saying "Access denied".
The account under which SQL Server Agent runs has full control on the folder that contains the batch file. The result of the batch would be deleting some files in a folder, calling a webservice and get those same files back from the webservice. I can run the batch file when I start it with my own (admin) account.
I googled and found several other questions and answers but none of those were covering my problem. I hope you can point to other options.
Thanks for your help.
Johan
Batch file contents:
echo Removing txt files of last run
del Employees.txt
del HrDepFun.txt
del HrEmpActual.txt
echo Files removed
echo Starting getconnectors
{Call Webservice} -> cannot disclose this on stackoverflow
echo Getconnectors done
Batch file execution statement from SQL Server Agent job (type Operating System (CmdExec)):
cmd.exe /c "c:\Program Files (x86)\AFAS\AFASRemote_Call_GetConnectors.bat" > connectorlog.txt 2> connectorerrorlog.txt