>In a network scenario, API functions such as GetCurrentDirectory() and GetModuleFilename() return a network drive letter. Is it possible or is there a function(s) to retrieve the server name instead of the drive letter?
>
Hi Bill,
I'm not quite sure that this is what you want (and given the problems I seem to be having in typing in the HTML tags, I'm not sure I'll type it the way I want:-)), but try this:
DECLARE INTEGER WNetGetConnection IN Win32API;
STRING @lpszLocalName, STRING @lpszRemoteName,;
INTEGER @lpcchBuffer
lclocal = "F:"
lcremote = SPACE(260)
lnsize = LEN(lcremote)
lnerr = WNetGetConnection(@lclocal, @lcremote, @lnsize)
IF lnerr = 0
lcremote = LEFT(lcremote, AT(CHR(0), lcbuffer) - 1)
ENDIF
hth,
George
Ubi caritas et amor, deus ibi est