Re: How to get current drive mapping
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 18 Mar 2007 21:17:18 -0400
Dave,
Unfortunately, the only option that you have here is to have the client
process do the resolution of the mapped drive to the UNC path. You can do
this on the client with the WNetGetUniversalName API function (you will have
to make the call through the P/Invoke layer).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
"Dave" <Dave@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5D025924-A27A-4942-900F-FEE0EFBAA80E@xxxxxxxxxxxxxxxx
I am actually trying to get the UNC path of the main module of a process
running from a mapped drive, and I am trying to do this from a service.
The
ProcessModule class only provides the full path with the mapped drive
letter,
but the drive letter refers to the drive mapping for the user that started
the process, and cannot be resolved to a UNC path from a service running
under LocalSystem.
Presumably, therefore, I need to get the drive mapping either for the user
account associated with the process, or possibly even for the process's
session ID (I am not clear whether mappings are per user or per session).
Can
anyone give me a clue as to how I go about this?
--
Dave
.
- Prev by Date: Re: How to derive from textbox to get an autoscroll property?
- Next by Date: C# Noob - Why check for null when raising event?
- Previous by thread: WCF not returning data in DataTable, even though that's what I told it to do
- Next by thread: Re: How to get current drive mapping
- Index(es):
Relevant Pages
|
Loading