Hi all,

Many thanks for all your replies. Unfortunately this service will be running on 
multiple PC, therefore I will not know at design time the user name of the 
logged on user.

Guess I'll just have to get the UserDocs directory from first principles :-(

Paul.

--- In [email protected], Robert Jenkins <uss...@...> wrote:
>
> Have you tried running the service under different accounts?  Since some of
> the directories returned by GetSpecialFolderPath are based on the current
> logged in user, you might modify the login for the service.
> 
> Robert
> 
> On Tue, Nov 10, 2009 at 5:20 AM, Paul <rm28...@...> wrote:
> 
> >
> >
> > 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.
> >
> >  
> >
> 
> 
> [Non-text portions of this message have been removed]
>


Reply via email to