windows – 如何获取不同语言的管理员组名称
发布时间:2020-12-14 02:56:06 所属栏目:Windows 来源:网络整理
导读:我正在使用Inno Setup开发安装程序,我需要创建一个具有管理员权限的 Windows用户,我可以使用此命令正常运行:net localgroup administrators USER / add 但是有一个问题……如果我在非英语Windows上执行此操作,“管理员”,组将不存在,又名:如果在pt-br Wind
我正在使用Inno Setup开发安装程序,我需要创建一个具有管理员权限的
Windows用户,我可以使用此命令正常运行:net localgroup administrators USER / add
但是有一个问题……如果我在非英语Windows上执行此操作,“管理员”,组将不存在,又名:如果在pt-br Windows上安装它将被称为“Administradores”. 我想知道是否存在一个存储管理组名称的Windows变量. 请注意,使用Inno Setup我可以使用vbs脚本. 解决方法
我对Inno Setup也做了一个功能,我想这对Delphi也适用.
完整的SID列表:http://support.microsoft.com/kb/243330/en Tks @nlsbshtr function GetNameBySID(const SID: string): string; var WbemLocator,WbemServices,WbemService,WbemObjectSets: Variant; begin; Result := ''; WbemLocator := CreateOleObject('WbemScripting.SWbemLocator'); WbemServices := WbemLocator.ConnectServer('localhost','rootCIMV2'); WbemObjectSet := WbemServices.ExecQuery('SELECT Name FROM Win32_Group where SID="'+SID+'"'); if not VarIsNull(WbemObjectSet) and (WbemObjectSet.Count > 0) then begin WbemObject := WbemObjectSet.ItemIndex(0); if not VarIsNull(WbemObject) then Result := WbemObject.Name; end; end; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- active-directory – 使用Windows加入Lion Open Directory是
- 可以在Windows上提供Grand Central Dispatch(`libdispatch`
- Windows 7 – 任务计划程序 – Windows 7
- entity-framework – 我可以在Windows Phone 8上使用Entity
- windows-server-2003 – 适用于Windows 2003的防病毒软件?
- Windows 8应用程序中Numericbox的替代品?
- iis-7 – 必须运行IISRESET两次才能启动所有与IIS相关的服务
- 自动获取windows或者linux系统IP
- windows – “login.ini”是保留名称吗?
- Windows 10工程版本泄露全新设计的操作中心圆角样式