I have a service that should copy some files over a network, the service is running under one of the local administrator accounts.
Logged in as that administrator I can manually copy the files from the network to a specific folder under
Program Files, but the service exists with a PermissionDenied exception to WRITE the file. I'm also sure that the files are not being locked before the writing.
The error is as follows:
Access to the path ".../SomeAssembly.dll" is denied.
Why is the service giving me such an error and how can I correct it? (I also developed the service, so changes to the assembly could be on the table).
I also tried running it under
System but it can't read the files on the network (dunno why) the
NetworkService accounts AFAIK don't have enough privileges to make changes to ProgramFiles... do they?
The reason why I can't use
System is because that account has no access to network resources by design, same happens for
NETWORK SERVICE that has no access to local resources. The problem with the administrator account seems to be that Windows is blocking the file-copy operation when it's performed by the service.