DECLARE WNetGetUser IN WIN32API ; STRING lpLocalDeviceName, ; STRING lpUserName, ; INTEGER @SizeOfUserNameBuffer * Get the local userid (Windows Login) cBuf = REPL(CHR(0),256) nBufSize = 256 IF WNetGetUser(0, @cBuf, @nBufSize) = 0 ? LEFT(cBuf,nBufSize-1) ENDIF * Get the userid used to attach to the mapped drive Z: cBuf = REPL(CHR(0),256) nBufSize = 256 IF WNetGetUser('Z:'+CHR(0), @cBuf, @nBufSize) = 0 ? LEFT(cBuf,nBufSize-1) ENDIFThe problem with SYS(0)/ID() and GetUserName() is that it isn't necessarily clear which of several user identities is being returned. I'm usually more interested in the userid that connected to the shared resource, which is the basis of rights granted to the shared resource, rather than the local user identity.