GetUNC - Get UNC path of local mapped drive v1.0

Copyright (c) 2004-2007 Gerald W. Gaston

Revision History:
v1.0 - Created.


------------------------------------------------------------------------------
Terms of Use:

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED. USE AT YOUR OWN RISK.

YOU MAY NOT DISTRIBUTE GETUNC WITHOUT THE EXPRESS WRITTEN PERMISSION OF GERALD W. GASTON.

------------------------------------------------------------------------------

GetUNC is a simple console utility that returns the UNC path of the drive letter provided. If the drive specified is not CONNECTED to a UNC path, then ERROR_NOT_CONNECTED is returned.


Syntax:
------------------------------------------------------------------------------
GETUNC Drive_Letter[:]


Notes:
------------------------------------------------------------------------------
Drive letter is not case sensitive.
An unavailable persistent connection will also return ERROR_NOT_CONNECTED.
A colon is optional after the drive letter.


Exit codes:
------------------------------------------------------------------------------
0   - Successful in retrieving the UNC path.
1   - Unsuccessful in retrieving the UNC path.
9   - All other errors (including showing help).



Examples:
------------------------------------------------------------------------------
GetUNC.exe H:
\\myserver\myHomeDir$

echo.%errorlevel%
0


GetLocal.exe K:
ERROR_NOT_CONNECTED

echo.%errorlevel%
1


Copyright 2004-2007 Gerald's Tools