WESL_UserSetting.SetCustomShell

此方法會根據安全性識別碼 (SID) ,為特定使用者或群組設定殼層啟動器。

語法

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

參數


[in, required]字串,包含設定 Shell 啟動器之使用者或群組 (SID) 的安全性識別碼。


[in, required]Shell 啟動器以殼層啟動的應用程式或可執行檔。

CustomReturnCodes
[in]可由殼層應用程式傳回的自訂傳回碼陣列。

CustomReturnCodesAction
[in]自訂傳回碼動作的陣列,決定 Shell 啟動器在殼層應用程式結束時所採取的動作。 自訂動作會對應至 CustomReturnCodes 的陣列。

下表定義可能的動作:

描述
0 重新開機殼層。
1 重新啟動裝置。
2 關閉裝置。
3 不執行任何動作。

DefaultAction
[In]Shell 啟動器在殼層應用程式結束時所採取的預設動作。

下表定義可能的動作:

描述
0 重新開機殼層。
1 重新啟動裝置。
2 關閉裝置。
3 不執行任何動作。

傳回值

傳回 HRESULT 值,指出 WMI 狀態WMI 錯誤

備註

Shell 啟動器會使用 CustomReturnCodesCustomReturnCodesAction 陣列,根據殼層應用程式的傳回值來判斷殼層應用程式結束時的系統行為。

如果 CustomReturnCodes中沒有傳回值,或者 CustomReturnCodesAction 中定義的對應動作不是有效的值,Shell Launcher 會使用 DefaultAction 來判斷系統行為。 如果未定義 DefaultAction ,或不是有效的值,Shell 啟動器會重新開機殼層應用程式。

規格需求

Windows 版本 支援
Windows 首頁 No
Windows 專業版
Windows 企業版
Windows 教育版
Windows IoT 企業版 是的