Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Login name and SYS(0) different
Message
From
19/10/2012 14:54:23
 
 
To
19/10/2012 11:09:30
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01555309
Message ID:
01555365
Views:
66
>>As far as I know sys(0) returns "computername#username".
>>
>>
>> cComputerUser = Sys    (0)
>> cComputer     = Left   (cComputerUser, At ("#", cComputerUser) - 2)
>> cUser         = Substr (cComputerUser, At ("#", cComputerUser) + 1)
>>
>> MessageBox ("ComputerName: " + cComputer + " User Name: " + cUser)
>>
>
>This much I do know. The problem is that the SYS(0) is NOT returning the current logged on user, but the user name that was assigned when the OS was installed.

Maybe you (or someone else) changed the user name from "User" to whatever it is now:

http://answers.microsoft.com/en-us/windows/forum/windows_7-security/how-to-change-user-name-in-windows-7-professional/d95ddaa7-4235-454e-83d6-77232207c7e2

A name change is cosmetic, a lot of underlying stuff doesn't get changed. If SYS(0) is relying on something that doesn't get changed, that might explain what you're seeing.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform