Mapping from mapped drive to real share

This is a discussion on Mapping from mapped drive to real share within the Windows Programming forums, part of the Platform Specific Boards category; Suppose I have this folder: R:\Extensions But the network share of this folder is \computer\somename$\Extensions How can I get the ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,551
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 09:35 PM
  2. %16 with double
    By spank in forum C Programming
    Replies: 11
    Last Post: 03-05-2006, 09: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, 03:38 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21