I have a batch file with the code below to stop and start the SQL Report service:
net stop "SQL Server Reporting Services (MSSQLSERVER)"
timeout /t 10
net start "SQL Server Reporting Services (MSSQLSERVER)"
I have set up the scheduled task to run daily, it currently runs as SYSTEM with the highest privileges set. I have set up the start in folder option on the action, and everything generally seems to be set up correctly. But when I run the task nothing seems to happen, it says the task has run but I cant see that the service has been restarted as it is meant to.
Can someone direct me to what I am missing? Thanks
For me it was trigger issue. By default it should
On a Schedule
in trigger tab. I had selectedAt log on
and then I was waiting to run task. As it's name says at log on, means you have to logout and log on.Try putting it on a Schedule and fire it every minute.
My application failed to start via "Task Scheduler".
The error in "Event Viewer" is:
System.IO.DirectoryNotFoundException
The "Task Scheduler" tries to run this application with the "SYSTEM" user. The problem was that a "network drive" was not mapped for the "SYSTEM" user. So what I did was, I created a ".bat" file and mapped the "network drive" before starting the application:
So check your logs first: "Event Viewer" -> Windows Logs -> Application
Set 'Program/script' -- > file.bat set 'Start in' the rest of path (file.bat)