Windowsservice an Mapped Drive

  • Thread starter Thread starter Mathias Fritsch
  • Start date Start date
M

Mathias Fritsch

My service runs under a Domain Account mydomain\myuser.
If I log into my system under this mydomain\myuser I have acces to a
mapped drive x:\ which is mapped to \\mydomain\mymachine\myfolder.

The service can acces \\mydomain\mymachine\myfolder but not x:\.
A winform application which I start when logged in as mydomain\myuser
has access to x.


Any ideas?

Mathias Fritsch
 
This is not the fact that you have access rights or don't, but that a mapped
drive only exists when you are logged in. A mapped drive is tied to a user's
profile, which is not used by a service running as that user.

If I were you I'd keep reference the path with the fully qualified UNC
anyway.

Cheers.
Dan.
 
Hello Daniel,

Your system account, which is used to start service, has no rights to the
mapped drive
U need to use your accound credentials with impersonalisation to start service
and then you get access to the mapped drive

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

DB> This is not the fact that you have access rights or don't, but that
DB> a mapped drive only exists when you are logged in. A mapped drive is
DB> tied to a user's profile, which is not used by a service running as
DB> that user.
DB>
DB> If I were you I'd keep reference the path with the fully qualified
DB> UNC anyway.
DB>
DB> Cheers.
DB> Dan.
DB> DB>
 
Daniel,

I didnt know that. Now the service creates the mapped drive and
everything works great.
Thank you

Mathias
 
Back
Top