Convert drive letter to actual network path
The story goes as follows:
I want to take note of the location of some files stored on a mapped drive, however, instead of taking the drive letter I would like to know the actual path to which the drive letter points to.
If anyone can help with this it would be much appreciated
Thanks
K
[318 byte] By [
keisslada] at [2007-10-3 11:14:57]

HeyI have a network share - something like \\server\mainbut I mapped a drive to this location, so X: now points to \\server\mainWhat I want to do is translate the mapped drive letter (X:) into the actual location (\\server\main)Thanks for the reply
I'd bet that's impossible in Java, because it is too platform specific. I can imagine an easy workaround by issuing an exec of "net use", then parsing it to find out, and create a Map of all the pairs ("X:", "\\server\location") you found. Later, you would use that map for resolving path names. Somewhat ugly but it may work in your environment.
I guess you cant, I just cant imagine a way to do java recognize it, maybe if you find a DOS command to do that you can use it in java too via Runtime.getRuntime ().exec ("Defined command");But I am not sure if this is possible.