Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.