subst

How do you retrieve the original location of a mounted path?

In C++, how can I retrieve the location of a mounted drive? for example, if I have mounted drive s: to c:\temp (using subst in the command line) "subst c:\temp s:" how can I get "c:\temp" by passing "s:" I would also like to know how can it be done for a network drive. (if s: is mounted to "\MyComputer\Hello", then I want to retrieve "...

Resolve Windows drive letter to a path (subst and network)

I wonder if there is a universal way of resolving a path using a drive letter (such as X:\foo\bar.txt) into its equivalent UNC path, which might be one of the following: X:\foo\bar.txt if X: is a real drive (i.e. hard disk, USB stick, etc.) \\server\share\foo\bar.txt if X: is a network drive mounted on \\server\share C:\xyz\foo\bar.txt...