win32wnet.WNetGetUniversalName

string/tuple = WNetGetUniversalName(localPath, infoLevel )

Takes a drive-based path for a network resource and returns an information structure that contains a more universal form of the name.

Parameters

localPath : string

A string that is a drive-based path for a network resource.
For example, if drive H has been mapped to a network drive share, and the network resource of interest is a file named SAMPLE.DOC in the directory \\WIN32\\EXAMPLES on that share, the drive-based path is H:\\WIN32\\EXAMPLES\\SAMPLE.DOC.

infoLevel=UNIVERSAL_NAME_INFO_LEVEL : int

Specifies the type of structure that the function stores in the buffer pointed to by the lpBuffer parameter. This parameter can be one of the following values.

Value Meaning
UNIVERSAL_NAME_INFO_LEVEL (=1)The function returns a simple string with the UNC name.
REMOTE_NAME_INFO_LEVEL (=2)The function returns a tuple based in the Win32 REMOTE_NAME_INFO data structure.

Return Value

If the infoLevel parameter is REMOTE_NAME_INFO_LEVEL, the result is a tuple of 3 strings: (UNCName, connectionName, remainingPath)