Re: How to get current drive mapping



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


.



Relevant Pages

  • Re: How to get current drive mapping
    ... ProcessModule class only provides the full path with the mapped drive letter, ... Presumably, therefore, I need to get the drive mapping either for the user ... session ID. ... The ProviderName property of the Win32_MappedLogicalDisk instance holds the UNC path name of the associated SessionID and the drive letter. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to get current drive mapping
    ... I've looked at WNetGetUniversalName but it has the same problem as ... drive mapping for that logon session and thus the UNC path. ... process do the resolution of the mapped drive to the UNC path. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: File Server Migration - Mapping in client machines
    ... FSMT does not touch the client and cannot help you to change the UNC paths ... > help me to change the UNC path at the client end if I am not using DFS?? ... >> my desktops are connected to the file server using UNC path. ... >> SBSM ...
    (microsoft.public.windows.server.migration)
  • RE: Random File Visibility
    ... Part of this also appears to be user accounts. ... Make sure that CLIENT accounts are on SERVER and have rights to the missing ... but if I view the same directory from SERVER through a UNC path ... > folders that are shared beneath it. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Photo Path on Network
    ... client names both in the folders and in the filenames. ... > We have a significant number of photos in our network CLIENTS directory, ... >>Put your pictures in a shared network folder, and use the UNC path to ... >>folder to refer to them. ...
    (microsoft.public.access.formscoding)

Loading