Windows Service: Copy files from a shared folder

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sebouh181
    New Member
    • Apr 2007
    • 26

    Windows Service: Copy files from a shared folder

    Hi,

    I have a Windows Service that copies xml files from a shared folder on the server.

    I am using System.IO.File. Copy(\\Server-Name\SharedDir) method. But whenever I try to copy files there is an error "Access is denied".

    I tried the same code in Windows application and it worls fine. The problem is present only in the Windows Service.

    Any suggestions?

    Thanks
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Change the user that your windows service runs under. By default its probably using a user that doesn't have access to the files.

    Comment

    • sebouh181
      New Member
      • Apr 2007
      • 26

      #3
      Thanks :)

      the problem is solved ;)

      Comment

      Working...