CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 1999
    Location
    Netherlands
    Posts
    57

    How to get network path from local path?

    Is it possible to convert from a shared directory (D:\data\MyShare) or mapped driveletter (lets say 'N:\') to the networkname (\\Client\MyShare\)?
    I know that the mapped drive is mapped with GetDriveType, but i must give the networkname (that is know by the server) to the server.

    An other problem (less important) is how to get from \\Client\disk1\test\ to D:\data\test\ ?
    (when are physical on this client)

    If anybody knows how to solve these problems (realy need the first one) i'm a happy person and can sleep a bit better :-)

    Mark





  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: How to get network path from local path?

    check out WNetGetConnection


  3. #3
    Join Date
    May 1999
    Location
    Netherlands
    Posts
    57

    Re: How to get network path from local path?

    Thanks Lothar,

    but this only works for mapped drives.
    Can i get the locally shared directory in any way?

    Like i shared a directory on my disk (say: C:\Data\ForAll\ shared as Mark), how can i detect if this directory is shared to the public?
    (convert to \\Client\Mark\)

    Mark



  4. #4
    Join Date
    May 1999
    Posts
    3,332

    Re: How to get network path from local path?

    I haven't tried it, but the description for NetShareCheck looks like it could give an answer to your question.


  5. #5
    Join Date
    May 1999
    Posts
    156

    Re: How to get network path from local path?

    I am about to jump into the same pool of 'trouble' water as you are. Check out the WNetxxxxxx series of function calls. I have not tried yet but they look promissing.

    Another place to look at is QueryDosDevice(..).

    Do let me know how you get on.

    Will


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured