Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UNC path from fullpath
#5
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.

Code:
Copy      Help
;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.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)