Results 1 to 5 of 5

Thread: conerting UNC network path to mapped drive path?

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    conerting UNC network path to mapped drive path?

    say i have a unc path like \\computer\share\folder
    How could i convert that UNC path to reflect the mapped drive path instead?
    for example if \\computer\share is mapped to drive D then the path for that folder would be D:\folder

    hope it's clear
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: conerting UNC network path to mapped drive path?

    here u go
    Attached Files Attached Files

  3. #3
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: conerting UNC network path to mapped drive path?

    You can also use WMI and list the drive letters using the Win32_LogicalDisk WMI class. Then its a matter of checking the DriveType property in order to find the ones that are "Network Drives"...

    Look at my post (#9) in this thread if you wish to see an example of this...
    http://www.vbforums.com/showthread.php?t=387657

  4. #4

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: conerting UNC network path to mapped drive path?

    thanks guys
    SEEMS to be the way to do it
    only if i could do this in MFC hehe
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  5. #5

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: conerting UNC network path to mapped drive path?

    hey kleinma, just a note that you need to convert both paths to lowercase (to ignore case when comparing) and also to make sure both do or don't end with a "\". Otherwise a valid match could be accidentally thrown out thanks for the code
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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