DECLARE INTEGER WNetGetUser IN WIN32API ; STRING lpDeviceName, ; STRING lpUserNameBuffer, ; INTEGER @BufferLength cBuffer = REPL(CHR(0),256) nBufSize = 256 IF WNetGetUser(0, @cBuffer, @nBufSize) = 0 * Got it ? LEFT(cBuffer,nBufSize - 1) ELSE * Something went wrong ENDIFThis will retrieve the login name for the local machine. If you wanted to see how the user was logged in to access a particular device, such as a mapped network drive Z:, you would use 'Z:'+CHR(0) in place of the first argument, ie