Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Current login username
Message
From
08/02/2006 18:40:23
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01094665
Message ID:
01094825
Views:
19
This message has been marked as the solution to the initial question of the thread.
>Did not work. "loUsers" did not return nothing and "crashed".
>
>Let me explain more: the user may have changed it's original account name only.
>Example: To simulate the trouble at my end, the account was created with Steve but changed to Steve1. The folder Steve in Documents and Settings still exist and all info point to it and it's ok. It's just the Login Username(Steve1) that have change. It could had been renamed has Bob or Mike instead of creating a new account. I have no control on that last part.
>

Hi Steve,
Try this:
Declare Long GetUserNameEx in Secur32 ;
   Long NameFormat, String @lpBuffer, Long @nSize

nBufLen = 260
cAccountName = repl( chr(0), nBufLen )
If (GetUserNameEx( 3, @cAccountName, @nBufLen ) != 0)
   ? 'Friendly Account Name: ' + left( cAccountName, nBufLen-1 )
else
   ** GetLastError() return 1332 if the account name was not changed from the original one
endif

Clear Dlls GetUserNameEx
HTH
Herman
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform