Parse output of "net use", but language varies - force language for "net use"?

Eliot Moss moss@cs.umass.edu
Sat Jul 20 13:58:05 GMT 2024


On 7/20/2024 9:44 AM, Mark Liam Brown via Cygwin wrote:
> Greetings!
> 
> I am trying to parse the output of "net use" in a bash script, but hit
> a roadblock:
> The output of "net use" changes with the language of the system
> (English, Danish, French, ...), so parsing becomes nearly impossible
> 
> How can I force the language used by "net use" to English, even if the
> system default language is Danish or French?
> 
> Mark

Poking around on the web a little suggests that Windows does not use an
environment variable like LANG to control the language.  Rather, the relevant
settings seem to live in the registry.  It seems a little dangerous and
fragile to me to change the registry and change it back, but that may be the
only approach unless there's a concept of "change a registry entry for this
session only" or something like that.

HTH, and I'm more than happy to have someone more knowledgeable expand or
correct this!

Eliot Moss


More information about the Cygwin mailing list