如何检测Windows的语言版本

发布于 2024-07-08 08:30:39 字数 167 浏览 6 评论 0原文

必需的是操作系统的真实语言版本,而不是用户界面语言或当前区域设置。

使用案例:必须应用安全设置和用户帐户创建的软件安装。 脚本必须知道某些系统属性,例如操作系统原始语言的用户组名称。

(应适用于 Windows XP、Windows Server 2003、Vista...)

Required is the true language version of the OS, not the user interface language or the current locale settings.

Use case: software installation which has to apply security settings and user account creation. The scripts have to know certain system properties like user group names in the original language of the OS.

(Should work with Windows XP, Windows Server 2003, Vista, ...)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

入怼 2024-07-15 08:30:39

要检测操作系统语言,请使用 GetSystemDefaultUILanguage

然而,有更直接的方法来查找诸如 Windows 中已知组名称之类的信息。 例如,要获取Users组的名称,请调用CreateWellKnownSidWellKnownSidType = 27 (WinBuiltinUsersSid) 然后 LookupAccountSid。 还可以查询其他知名用户和组的名称。

To detect the operating system language use GetSystemDefaultUILanguage.

However, there are more straightforward ways to find things such as a known group name in Windows. For example, to get the name for the Users group call CreateWellKnownSid with WellKnownSidType = 27 (WinBuiltinUsersSid) and then LookupAccountSid. The name for other well-known users and groups may be queried as well.

柠北森屋 2024-07-15 08:30:39

操作系统中的所有本地化名称都有一种与语言无关的方式来访问它们,以供本机应用程序和安装脚本使用。 管理员、用户、来宾组和管理员帐户都有众所周知的 SID,可以用来代替本地化名称。 需要额外考虑的一点是,内置主体的所有默认名称都可以更改,并且通常是出于善意但令人困惑的系统管理员,他们认为将域管理员帐户或组名称更改为非默认名称等于提高安全性。 即使它们是操作系统安装语言的正确名称,您也不能依赖它们。 更糟糕的是,某些语言本地化在不同语言的操作系统版本之间会发生变化。 因此,您需要在操作系统版本和语言的预期名称之间构建非常仔细的映射。

最好不要。 了解如何为您的脚本环境构建区域设置中性 ID。

All localized names in the OS have a language neutral way to access them for use by native applications and setup scripts. the administrators, users, guests groups and administrator account have well known SIDs that can be used in place of a localized name. An extra point to consider is that all the default names of the built in principals can be changed, and often are by well meaning but confused sys admins that belive that changing the domain admins account or group names to a non default equals increased security. You cannot rely on these things even being the correct name for the OS's installation language. Even worse, some of the language localizations change between OS releases for a language. So you would need to construct a very careful mapping between OS versions and expected names for languages.

Rather don't. Find out how to build the locale neutral id for your scripting environment.

烟火散人牵绊 2024-07-15 08:30:39

到目前为止我最好的解决方案:枚举本地用户帐户和组,并与不同语言的已知名称列表进行比较。

My best solution so far: enumerate the local user accounts and groups and compare with a list of known names in different languages.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文