Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I get system locale in Windows 7?

I mean something like: cs_CZ.UTF-8

I tried writing "locale" in the command line but that doesn't work in Windows. Any suggestions?

share|improve this question
up vote 11 down vote accepted

There's not a specific command (or at least, not one that I'm aware of) to get this information, but you can find it between those provided by systeminfo.exe.

share|improve this answer
    
When running systeminfo on a command line, a lot of information is output to the screen. The relevant information to look for is: System Locale: en-us;English (United States) Input Locale: en-us;English (United States) – djondal May 30 '14 at 8:40
    
systeminfo /FO csv | ConvertFrom-Csv | select *locale – Ogrish Man Mar 6 '15 at 11:04
    
@Ogrish Man : This seems to be a Powershell command, but it gives me no output. Maybe because the headers are not in English. systeminfo.exe by itself works, as does gWaldo's answer in PS – mivk Jun 16 '15 at 16:19

Get-UICulture or Get-Host in PowerShell

(capitalization optional)

share|improve this answer

If you need the actual locale to conditionally do other things in a batch file you can create a batch file (save a text file as .bat extension) with the following. As a starting point this will print to the command prompt, for example, "en-us" (no quotes) You can also use the variable !VERBOSE_SYSTEM_LOCALE! for the human readable locale e.g. English(UnitedStates)

@echo off
setlocal EnableDelayedExpansion
FOR /F "delims==" %%G IN ('systeminfo.exe') Do  (
    set input=%%G
    for /l %%a in (1,1,100) do if "!input:~-1!"==" " set input=!input:~0,-1!
    IF "!input:~0,13!"=="System Locale" (
        set answer=!input:~15!
        set answer=!answer: =!
        set VERBOSE_SYSTEM_LOCALE=!answer:*;=!
        call set SYSTEM_LOCALE_WITH_SEMICOLON=%%answer:!VERBOSE_SYSTEM_LOCALE!=%%
        set SYSTEM_LOCALE=!SYSTEM_LOCALE_WITH_SEMICOLON:~0,-1!
        echo !SYSTEM_LOCALE!        
   )
)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.