Jump to content

Recommended Posts

Posted

I have written a batch file that returns the full unc path of the command-line argument. It works on network shares only (not local drives). There used to be either a DOS 6 (or was is Novell) command that did this, but I have not seen it since then.

Example:

H:\My Data Sources>truename DATACONN.HTC
"\\myserver\home\jftuga\My Data Sources\DATACONN.HTC "

I use this whenever I have to cut & paste file names as it saves a lot of time.

You can download it here...

http://www.fcs.uga.edu/~john/truename.zip

Enjoy!

-John


  • 1 year later...
Posted (edited)

I have optimized this batch file. It now requires no external program dependencies that are not already built into Windows XP.

Here it is:

@echo off
for /f "usebackq tokens=1,2,3,4 delims= " %%i in (`net use^|findstr /i %~d1`) do @echo "%%k%~p1%~n1%~x1"

Example:

J:\scripts\misc>truename.bat test.pl

"\\myserver\users\john\scripts\misc\test.pl"

-John

Edited by jftuga

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...