On Windows Server 2008, i was scheduling a task to run a batch file which in turn will trigger a console application. When double clicked on the application, its running perfectly. But when ran from the task scheduler i was getting the below error in the logs.
exception from hresult 0x800a03ec
The ID with which i was logged in and running task scheduler had full admin rights.
I had tried these solutions.. Batch File runs manually but not in task scheduler
Batch file called by scheduled task throws error when scheduled, runs fine when double clicked
Batch runs manually but not in scheduled task
But the issue is not resolved. Infact when ran from task scheduler its triggering both success and exception mails in the console application. But this is not the case when ran manually. Need help!!
Note: All the output reports i am processing through console application will be in .xlsx format.
The batch file is as mentioned below
@ECHO.
@ECHO /***************************************************************/
@ECHO Report Application
@ECHO /**************************************************************/
@For /F "tokens=2,3,4 delims=/ " %%A in ('Date /t') do @(
Set Month=%%A
Set Day=%%B
Set Year=%%C
)
SET DRV=E:\ReportApplication
cd %DRV%\bin\Release\
ReportSolution.exe >> %DRV%\Log\ReportSolutionlog%Month%%DAY%%Year%.txt
cd\
cd %DRV%
@ECHO Application is completed successfully
@ECHO /**********************************************/