WESL_UserSetting.SetCustomShell

此方法根据 SID) 的安全标识符 (为特定用户或组配置 Shell 启动器。

语法

[Static] uint32 SetCustomShell (
    [In, Required] string Sid,
    [In, Required] string Shell,
    [In] sint32 CustomReturnCodes[],
    [In] sint32 CustomReturnCodesAction[],
    [In] sint32 DefaultAction
);

参数

Sid
[in, 必需]一个字符串,其中包含要为其配置 Shell 启动器的用户或组 (SID) 的安全标识符。


[in, 必需]Shell 启动程序作为 shell 启动的应用程序或可执行文件。

CustomReturnCodes
[in]shell 应用程序可以返回的自定义返回代码数组。

CustomReturnCodesAction
[in]自定义返回代码操作的数组,用于确定 Shell 启动程序在 shell 应用程序退出时执行的操作。 自定义操作映射到 CustomReturnCodes 数组

下表中定义了可能的操作:

描述
0 重启 shell。
1 重启设备。
2 关闭设备。
3 不执行任何操作。

DefaultAction
[In]Shell 应用程序退出时 Shell 启动器采取的默认操作。

下表中定义了可能的操作:

描述
0 重启 shell。
1 重启设备。
2 关闭设备。
3 不执行任何操作。

返回值

返回一个 HRESULT 值,该值指示 WMI 状态WMI 错误

备注

Shell 启动器使用 CustomReturnCodesCustomReturnCodesAction 数组根据 shell 应用程序的返回值来确定 shell 应用程序退出时的系统行为。

如果 CustomReturnCodes 中不存在返回值,或者 CustomReturnCodesAction 中定义的相应操作不是有效值,则 Shell 启动器使用 DefaultAction 来确定系统行为。 如果未定义 DefaultAction 或 不是有效值,Shell 启动器将重启 shell 应用程序。

要求

Windows 版本 支持
Windows 主页
Windows 专业版
Windows 企业版
Windows 教育版
Windows IoT 企业版