By default, the service works under SYSTEM user (not your logged user in MS 
Windows) and as result, the SYSTEM have no personal folder

You may change the option for service (in Services list you may open the 
Property dialog) and run the service under another account/user

At least it works in Windows XP

With best regards, Mike Shkolnik
EMail: [email protected]
http://www.scalabium.com


--- On Tue, 11/10/09, Paul <[email protected]> wrote:

> From: Paul <[email protected]>
> Subject: [delphi-en] Windows Service Application
> To: [email protected]
> Date: Tuesday, November 10, 2009, 1:20 PM
> Hi all,
> 
> I am in the process of rewriting one of my utility
> applications as a windows service.
> 
> Basically the app monitors a known subdirectory of MyDocs,
> in the exe I make a call to
> GetSpecialFolderPath(CSIDL_PERSONAL) which quite happily
> returns the path to the Local Users MyDocs directory.
> However, when I try to do the same thing inside a windows
> service app GetSpecialFolderPath(CSIDL_PERSONAL) returns an
> empty string!
> 
> Also, having got the correct directory I then copy some
> common lookup files from a network share into it. This also
> fails when run under windows service (this is probably
> related to the same problem as above).
> 
> Any ideas gratefully received.
> 
> Paul.



      

Reply via email to