How to get from a python script, running with cmd administrator rights, the hostname or ip from mapped letter? with this post Python 2: Get network share path from drive letter:
import win32wnet
import sys
print(win32wnet.WNetGetUniversalName(sys.argv[1], 1))
This gives me something like this when I run it:
C:\test>python get_unc.py i:\some\path
\\machine\test_share\some\path
This works if I run without administrator privileges, but I need to run with admin rights.