wsv01 Posted February 9, 2019 Share Posted February 9, 2019 I have an application running as a service. The service properties are set to log on as the local system account. I have a test set up to try and create a file in the files folder. Here is my code using a TuniDBMemo object. memo.Lines.Clear; memo.Lines.Add('hello'); memo.Lines.SaveToFile(UniServerModule.FilesFolder + 'MyFile.txt'); When I run the application, I receive this error. Why is it trying to create the file in a files folder below the system32 folder? "C:\Windows\system32\files\MyFile.txt". Quote Link to comment Share on other sites More sharing options...
Jean-Marc Kiener Posted February 9, 2019 Share Posted February 9, 2019 Create a own local account. Run the service under this account. Set read/write permissions for this account to all directories you want to write. Quote Link to comment Share on other sites More sharing options...
wsv01 Posted February 9, 2019 Author Share Posted February 9, 2019 Thanks for the info. I tried that. I did figure it out. I ended up using something like this. memo.Lines.Clear; memo.Lines.Add('hello'); memo.Lines.SaveToFile(UniServerModule.ServerRoot + 'files\MyFile.txt'); I was able to use the local system account and get everything to work. I'm not sure this is the perfect answer, but it works for my needs. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.