FYI, this question has been cross-posted from Stack Overflow.
I have a very simple program that copies files from one location to another, and I have scheduled its run everyday using the Windows scheduler.
When the scheduler launches it, it fails and logs:
System.UnauthorizedAccessException: Access to the path '' is denied.
If I just launch the program by double clicking it, it fails with the same error as above.
- When I run the program manually with "Run as" and use the same credential that I used in the Windows scheduler it runs successfully.
The credential used in all the three cases is the one that I use to login to the system.
Can anybody please help me in understanding why this is happening?