I am using the GetEnvironmentVariable('USERNAME') system call in a Delphi application as part of the licensing system. For 99% of the users it works flawlessly, but for a few users the call sometimes returns an empty string. For those users it seems like the return of the call can change between empty and the correct username several times each day. Have anyone experienced anything similar and found a solution?
A bit of extra info:
- We log the username each time the application is started so we can see the changes.
- We have not been able to reproduce the problem on one of our own machines.
- According to the users they have not made any changes that could cause this e.g. they are logging in to the same PC with the same username as always.
- This has started occurring within the last few months, or at least it is happening much more frequently recently.