Service accessing mapped drive

G

Guest

I have a service which is a Windows Service, but it is running under a User
account - I enter my own credentials on installing.
It can access network files by specifying the full UNC path, i.e.
\\server\share, but it can't use mapped drive letters.
Is there anyway I can modify it so that it can?

Thanks
 
W

Willy Denoyette [MVP]

In another post I told you that mapped drives are (Logon) session bound.
That means if an interactive user creates a use record (maps a drive), all
programs running in this session will have access to the mapped drive,
however, programs running in another logon session don't have access to
this/these mapped drives.

That means you need to create another use record from within your service.
But, really, I would never ever use a mapped drive, why not simply use a UNC
path?

Willy.
..
 
G

Guest

Well, I had thought that because the service was logging on as me when it
installed (as it is a "User" account installer), it would be able to access
my mapped drives. But since as you say they're session bound, I will just use
a UNC path.
 
W

Willy Denoyette [MVP]

Each Logon Session is a separate security context, even if you use the same
credentials. Guess what would happen to your service when the interactive
user logged off effectively closing the session and as such releasing the
mapped drives.

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top