i have a C# program that executes some commands and writes output to a txt file. It has to run indefinitely so i added it to Task Scheduler to start it every ten minutes if it isn't running already. This task has highest privileges.
The problem is if the program is started by the Task Scheduler it can't write to the log file. If i start it normally there are no problems. I searched around the net but couldn't find an answer and i can't seem to debug this problem.
Thanks in advance.
This code will help for the error log.
You have to add this code in the catch block.