Making system calls (Windows Command Prompt) in English

I am working on a Perl script that needs to make some system calls to get some system data. To correctly parse the output of these calls on any computer, I must be sure that the output of the call is set to English.

The problem that I am facing is that, for example, on my PC, I get localized output from these commands. My Windows is configured in Spanish, therefore, how systeminfo returns data in Spanish.

Is there a command (or something else) that I can run in a command call to make all system calls, as if the system was always in English without changing anything in the system configuration?

Thanks in advance for your comments.

REWARDS NOTES: The answer to this problem should not in any way interfere with the system. This should be a way to get English answers from system calls / commands that work on any computer without changing its configuration, registry or others.

+4
source share
2 answers

This solution allows you to execute a command prompt in English. It modifies some registry keys, but also modifies them if you want. You can run the same commands as in .bat so that the system switches to English and they return to localized ones.

If you are trying to run commands that require adminsitrator privileges, you can easily include these calls in your program.

NTN

0
source

I think the WMIC team is your best. This is a standard Windows feature with Windows XP.

WMIC has full access to the Windows system (taking into account user rights, etc.) and has a locale parameter that selects the locale that is valid (for the command) from the installed language packs.

The locale is selected from the list here .

To get the current username using US English (if available), you should use wmic /locale:ms_409 netlogin get name

Through the WMI interface, you may not even need to localize the results (that is: with sufficient care, you can simply get the raw data).

+1
source

Source: https://habr.com/ru/post/1480925/


All Articles