Thread: Mapping from mapped drive to real share

  1. #1
    Registered User
    Join Date
    Jun 2004
    Posts
    201

    Mapping from mapped drive to real share

    Suppose I have this folder:

    R:\Extensions

    But the network share of this folder is
    \\computer\somename$\Extensions

    How can I get the second value from the first?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    You could try looking in the registry, under
    HKEY_CURRENT_USER\Network
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jun 2004
    Posts
    201
    Nothing in HKCR, HKLM and HKCU.

  4. #4
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Code:
    TCHAR szUnc[MAX_PATH];
    
    if (NOERROR == WNetGetConnection(TEXT("R:"), szUnc, MAX_PATH))
    {
        printf("Unc path of 'R:' is '%s'", szUnc);
    }
    else
    {
        printf("No luck!");
    }

  5. #5
    Registered User
    Join Date
    Jun 2004
    Posts
    201
    WNetGetConnection

    That's the one I was looking for.

    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows Scripting. Share Drive
    By Loic in forum Windows Programming
    Replies: 2
    Last Post: 01-22-2008, 10:35 PM
  2. %16 with double
    By spank in forum C Programming
    Replies: 11
    Last Post: 03-05-2006, 10:10 PM
  3. C++ Share Interface Problem
    By Morphios in forum C++ Programming
    Replies: 0
    Last Post: 04-28-2003, 07:30 PM
  4. XP Shared Drive Problem(?)
    By Davros in forum Tech Board
    Replies: 2
    Last Post: 10-06-2002, 01:37 PM
  5. Programming Puns
    By kermi3 in forum A Brief History of Cprogramming.com
    Replies: 44
    Last Post: 03-23-2002, 04:38 PM