DECLARE INTEGER NetUserGetInfo IN NETAPI32 ; STRING @ servername, ; STRING @ username, ; INTEGER level, ; INTEGER lpBufPtr DECLARE INTEGER WNetGetUser IN WIN32API ; STRING @ lpName STRING @ lpBuffer INTEGER @ lpnLength cName = 0 cBuff = SPACE(256) nLen = 256 * Get the Windows Login Name =WNetGetUser(cName, @cBuff, @nLen) * Store the login name in a variable, stripping excess buffer cUser = LEFT(cBuff,AT(CHR(0),cBuff)-1) * We need a couple of functions from CLSHEAP, so SET PROCEDURE TO CLSHEAP ADDITIVE cMyServer = 0 && null pointer selects local machine nPtr = 0 && init so we can return something in it IF NetGetUserInfo(cMyServer, cUser, 11, @nPtr) = 0 * nPtr contains a pointer to a buffer containing a USER_INFO_11 cUSERINFO = GetMem(nPtr,80) && the structure is 80 bytes long =DeAllocNetAPIBuffer(nPtr) && release the NetAPI buffer at (nPtr) nPriv = DWORDToNum(SUBST(cUSERINFO,17)) && 5th DWORD is priv level * 0 = Guest, 1 = User, 2 = Admin nAuth = DWORDToNum(SUBST(cUSERINFO,21)) && 6th DWORD is auth bitmask * Print Op 1, Comm Op 2, Server Op 4, Account Op 8 ENDIFYou might find the information in a level 2 (USER_INFO_2 structure) more useful - the user should be able to query his own account at level 11 at a minimum. You'll probably need to look at the MSDN docs on the API call and the structures; if you have an MSDN subscription, it's in the Platform SDK documentation, the constants can be found in LMACCESS.H in the INCLUDE directory of VC++. You can also access the Platform SDK docs from the MSDN online web site.