- Joined
- 8 Apr 2005
- Messages
- 16,950
Does anyone know of any slick console (cmd.exe) commands that will return the UNC path of a mapped drive with no other text? I need to isolate the UNC path to store it in a text file. So far I have this:
C:\>net use t:
Local name T:
Remote name \\server\share
Resource type Disk
Status OK
# Opens 0
# Connections 1
The command completed successfully.
But all I want is the value of the "Remote name", and I am limited strictly to console commands like dir, echo, net, and so on. A batch file would work fine if you have a set of commands that will get the same result. I am looking to append the value into a text file with a simple redirection like this:
C:\>net use t: >> UNCPath.TXT
Any DOS/cmd gurus know of any tricks to do that? It has to be something that can execute on any PC (2k or XP) without installing anything.
C:\>net use t:
Local name T:
Remote name \\server\share
Resource type Disk
Status OK
# Opens 0
# Connections 1
The command completed successfully.
But all I want is the value of the "Remote name", and I am limited strictly to console commands like dir, echo, net, and so on. A batch file would work fine if you have a set of commands that will get the same result. I am looking to append the value into a text file with a simple redirection like this:
C:\>net use t: >> UNCPath.TXT
Any DOS/cmd gurus know of any tricks to do that? It has to be something that can execute on any PC (2k or XP) without installing anything.