DECLARE INTEGER WNetGetUser IN WIN32API ; STRING @ lpName, ; STRING @ lpUsername, ; INTEGER @ lpnLength cDriveName = 'Z:' + CHR(0) && the drive you want to check on cBuffer=SPACE(200) && where the username will be returned nLength = LEN(cBuffer) && the size of the buffer nResult = WNetGetUser(cDriveName, @cBuffer, @nLength) IF nResult = 0 * it worked, and the buffer contains the name ? 'UserID for the Drive Z: mapping - ' + LEFT(cBuffer, AT(CHR(0),cBuffer) - 1) ELSE * it did not work, lots of possible reasons * You can determine the exact reason from the return value * see the MSDN documentation for the meaning of the error codes ENDIFI'd strongly recommend that you get the MSDN documentation; it's provided when you purchase Visual Studio, or you can purchase an annual subscription that will provide quarterly updates to the CDs at a minimum. The documentation can also be accessed on-line via MSDN OnLine, a free service from Microsoft (http://msdn.microsoft.com).