WMI query on a non-english system

I need to request WMI-Api on German and English computer. But different systems have different results.

For example:

I need to request "Msvm_ComputerSystem". There is a "Caption" property. On an English computer, the result is "Virtual Machine" and on a German computer, the result is "Virtueller Computer".

How can I force the language to en-us?

+3


source to share


1 answer


Don't know if this will work, but it's worth trying. Before executing your query, change the culture of the current thread to CultureInfo.Invariant

:



Thread.CurrentThread.CurrentCulture = CultureInfo.Invariant;

      

0


source







All Articles