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.

  1. When the scheduler launches it, it fails and logs:

    System.UnauthorizedAccessException: Access to the path '' is denied.

  2. If I just launch the program by double clicking it, it fails with the same error as above.

  3. 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?

link|improve this question
Please do not cross post between sites, this creates more noise and confusion. Thanks! – Wuffers Mar 27 '11 at 1:18
Just a random thing I found googling, can you give the permissions to the NETWORK SERVICE user instead of whatever the current user is? – CreeDorofl Mar 27 '11 at 2:55
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.