views:

146

answers:

2

I have batch files, its copy some files from network to local disk. When try to run it from a windows service I get an error like "Access Denied".

I already try run windows service as LocalSystem , LocalService and NetworkService. All these types get same error.

Have any idea ?

Thanks

+3  A: 

NetworkService is the only one that is going to include network credentials here, and that will be the local machine's identity. Does the machine account have access to the share? If this isn't correct, you'll need to run the service as a dedicated, specific user account.

Marc Gravell
+1 Though you should just go ahead and use a dedicated service account rather than give NetworkService access. This is consistent with the principle of least privilege as there are lots of services that might use the NetworkService account and get access where they don't need it.
tvanfosson
A: 

What version of windows is this ? And have you checked the effective ACL settings of the shared files/folders ?

Try changing the ACL on the shared resource to allow everyone access...

If that works you need to give DOMAIN\networkservice the correct permissions. In this case both machines would need to be in the correct domain.

Hassan Syed