I am using French Localized Windows Operating system.
I am using GetUserName() Windows API to get current logged in username for the process.
On French Windows it returns “Système” instead of “System” for the Service process. Because of this our System Software failing in a specific scenario.
Is there any way to get English UserName on French Windows ?
I might be mixing up the accounts now, but I think you should be comparing using the SIDs rather than the usernames. For example, the
Local Systemaccount always have SIDS-1-5-18.You can find a list of standard SIDs here: Well-known security identifiers in Windows operating systems
And if you need to go from account name to SID you can use the LookupAccountName API (maybe easier ways of doing it, but that was the first one I could think off).