Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to install some version of one package depending on the SO language. How can I get it using a batch file? I'm using W7 professional.

share|improve this question

closed as off topic by TFM, RedGrittyBrick, Simon Sheehan, CharlieRB, 8088 Dec 27 '12 at 5:04

Questions on Super User are expected to relate to computer software or computer hardware within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 4 down vote accepted

You would need to identify the language codes that you care about. Here is one reference MS Language Codes. Then you could get the code for the current windows install via wmic in your batch file:

wmic path win32_OperatingSystem get OSLanguage

From David's comment, to set the value, use the WMIC /value switch:

for /f "tokens=2 delims==" %%A in ('wmic path win32_OperatingSystem get OSLanguage /Value') do set Language=%%A
share|improve this answer
    
Thanks for your answer! It works. I found also this other piece of code: set Key="HKEY_CURRENT_USER\Control Panel\International" for /F "tokens=3" %%a in ('reg query %Key% ^| find /i "LocaleName"') do set Language=%%a –  AbrahamSustaita Dec 26 '12 at 16:18
    
How can I set that to a variable? @EBGreen –  AbrahamSustaita Dec 26 '12 at 16:21
    
@AbrahamSustaita To set it to a variable use the /Value option and and a for loop parse: for /f "tokens=2 delims==" %%A in ('wmic path win32_OperatingSystem g et OSLanguage /Value') do set Language=%%A –  David Ruhmann Dec 26 '12 at 16:56
    
Thanks a lot to everyone! –  AbrahamSustaita Dec 26 '12 at 17:03

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