UNCFromMappedDrive
Purpose
UNCFromMappedDrive converts a (local) drive mapping to a network share/drive to
its UNC path notation. Additionally an ERROR_LEVEL is returned for success (0) or
failure (255).
Download
UNCFromMappedDrive
Installation
None. Download the ZIP file, extract the included executable and run it.
Please note: this is a console application. You should run it from a command prompt.
Use case(s)
-
-
Convert a local drive letter/path to its UNC notation for further use
in (automated) messaging/notification systems, to avoid confusion as to
which file/folder is referred to in the message.
Syntax
UNCFromMappedDrive <mapped drive/folder>
Examples
UNCFromMappedDrive W: (drive only)
UNCFromMappedDrive W:\MyData (drive & path)
The second example will expand the local drive letter to its UNC path
and - for your conveniance - adds the additional file/path information to the
UNC path. Let's say in the above example drive W: resolves to e.g.
\\MyServer\MyNetworkShare, then W:\MyData will
be resolved to
\\MyServer\MyNetworkShare\MyNetWorkData\MyData.
Source code
The PowerBASIC source code is available at Github
Known issues / limitations
-
This tool will not check for the existance/accessability of the passed
information. It simply resolves the mapping.
-
If for whatever reason no valid mapping can be determined, the original drive/path
will be returned. In this case the tool sets the ERROR_LEVEL to 255.
Version
-
1.0.3 - June 2019
-
The resulting UNC path is copied to the clipboard.
-
1.0.2 - May 2017
-
Compiler glitch workaround.
-
1.0.1 - February 2017
-
Up'd the version number to reflect the code refactoring for publishing on Github.
The functionality hasn't changed.
-
1.0 - January 2014