jftuga Posted March 13, 2006 Posted March 13, 2006 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.zipEnjoy!-John
LLXX Posted March 14, 2006 Posted March 14, 2006 Doesn't the Windows command processor already have an undocumented TRUENAME command?
jftuga Posted March 23, 2007 Author Posted March 23, 2007 (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 offfor /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 March 23, 2007 by jftuga
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now