Hello. What .batch command to check the currently used language on the system? (not default language) I have a code that checks the default system language and goes to a separate code depending on whether the detected language is Polish or another = English: @echo OFF FOR /F "tokens=2 delims==" %%l IN ('wmic os get OSLanguage /Value') DO set OSLanguage=%%l IF %OSLanguage% == 1045 GOTO L_POLISH IF %OSLanguage% NEQ 1045 GOTO L_ENGLISH :L_POLISH echo Polish was detected pause exit :L_ENGLISH echo English was detected pause exit The problem is that if we install the system in e.g. Polish, and then change the language in the system to English, German, etc., the code will not detect and will not set / display and will not go to the code for the English version, but will detect the default Polish and go to Polish code. What command can I use as a check to make the code verify the currently used version of the system language instead of the default language? If I can, please let me know @abbodi1406 Best regards
Hi! Maybe you can test this code: Code: FOR /F "skip=2 tokens=2*" %a IN ('REG QUERY "HKEY_CURRENT_USER\Control Panel\International" /v "LocaleName"') DO SET "OSLanguage=%b" IF "%OSLanguage%"=="pl-PL" ( echo Polish was detected. ) pause EXIT Best regards
@Tux 528 Welcome. I only noticed this message because I had not seen it before, I did not receive a notification. I checked this code and unfortunately it does not work for me because it does not execute after copying and pasting it into a .bat / cmd script. The console starts up and shuts down instantly without any displayed information. Of course I removed "EXIT" at the end and left the "PAUSE" command alone, but that doesn't work.
@RemixPL1994 use double %% in batch script Code: FOR /F "skip=2 tokens=2*" %%a IN ('REG QUERY "HKEY_CURRENT_USER\Control Panel\International" /v "LocaleName"') DO SET "OSLanguage=%%b"