I'm trying to read the account language to a variable within a batch file. It can be in text (en-US), hex (0x0409) or decimal (1033), preferably the first. I've tried WMIC but could only find commands for the OS Language: "WMIC OS GET LOCALE" returns 0816 "WMIC OS GET LOCALE" returns 2070 Both language codes correspond to pt-PT or Portugal, which is the original OS language, but my current account is in English with International settings for Portugal (timezone, currency, etc). I also searched the Registry and found these values: [HKEY_CURRENT_USER\Control Panel\Desktop] PreferredUILanguages, REG_MULTI_SZ, en-US [HKEY_CURRENT_USER\Control Panel\International\User Profile] Languages, REG_MULTI_SZ, en-US Since these values are REG_MULTI_SZ and both Names are plural, does it mean they can contain more than one language, or is it safe to assume they will only contain one language with 2 to 5 characters (xx or xx-xx)?
What result do you get if you use powershell from a batch file? Code: @For /F %%A In ('PowerShell -C $Host.CurrentUICulture.Name') Do @Set "UIC=%%A" @Echo=[%UIC%] @Timeout 5 1>Nul
That's exactly what I needed, thanks! The output is "en-US", exactly the language my account is using, and the exact output I need