2

I have created a Windows Service that has a function that creates a new file.

It is running under "Local System account" with "Allow service to interact with desktop" set to true.

When running under this account can files be created locally?

I can't debug this to get the exact error as it is running in a Lab Manager environment that has no suitable debugger installed.

It looks to me to be a permissions problem based on when the service crashes so the simple answer I need before trying anything else is can this account create files on the Local System?

I can't seem to find a site with the answer...?

Any help would be greatly appreciated.

Dan Harris
  • 1,336
  • 1
  • 21
  • 44
  • Where do you want to write that file? – H H Sep 06 '10 at 13:28
  • To a local hard drive, however the drive is shared over the network. The actual drive and folder etc are on the same machine that the service is running on, but that folder is shared to other machines on the network if that makes a difference – Dan Harris Sep 06 '10 at 13:56

1 Answers1

2

"Allow service to interact with desktop" is only needed to be able to display messages for a logged in user.

Local System should have write access to local hard drives. You can not access mapped network drives or any other network resources for that matter.

jgauffin
  • 99,844
  • 45
  • 235
  • 372
  • What about a local folder that is shared on the network? Would that turn it into a network resource in the eyes of Windows even though the folder is on the local machine? – Dan Harris Sep 06 '10 at 13:32
  • 2
    I'm unsure if you use the UNC path ("\\computername\sharename"). Accessing it using a local path ("C:\sharedfolder") should work OK. – jgauffin Sep 06 '10 at 15:12
  • If you're in a domain, the service will authenticate with the domain computer account to other systems. If not on a domain, you'll need to use NetUseAdd to specify a remote username and password to set up the remote path. – Chris Smith Sep 20 '10 at 21:05