03-18-2008, 08:20 PM
Can be used WNetGetUniversalName, but it seems that it only can get UNC of remote location when it is mapped to a drive letter on local computer. Also, it works on XP but does not work on Vista. Maybe this is only on my computer.
But returned path is invalid. Must be \\VISTA32\app\qm.exe.
;assuming \\VISTA32\app is mapped to drive Z:
str path="Z:\app\qm.exe" ;;path on remote computer
str s.all(500)
int n=500
int e=WNetGetUniversalName(path UNIVERSAL_NAME_INFO_LEVEL s &n)
if(e) end _s.dllerror("" "" e)
lpstr unc; memcpy &unc s 4
out unc ;;\\VISTA32\app\app\qm.exe
;or out s+4
But returned path is invalid. Must be \\VISTA32\app\qm.exe.