DECLARE INTEGER WNetGetConnection IN WIN32API ; STRING @ lpLocalName, ; STRING @ lpRemoteName, ; INTEGER @ lpnLength LOCAL cLocalDevice, cUNCBuffer, nLength cLocalDevice = LEFT(FULLPATH(tcPathName),2) + CHR(0) cUNCBuffer = REPL(CHR(0),261) nLength = LEN(cUNCBuffer) IF WNetGetConnection(cLocalDevice, @cUNCBuffer, @nLength) = 0 RETURN LEFT(cUNCBuffer,AT(CHR(0),cUNCBuffer)-1)+SUBST(FULLPATH(tcPathName),3) ELSE RETURN NULL ENDIFThe server is the name between '\\' and the following '\'