您可以使用自訂的 Windows 傳統型應用程式,然後啟動 UWP 應用程式,例如 [設定] 和 [觸控式鍵盤]。
您可以從自訂 UWP 殼層啟動次要檢視,並在多個監視器上執行。
自訂殼層應用程式會以全螢幕執行,並可視使用者的需求以全螢幕執行其他應用程式。
如需不同應用程式組合的範例 XML 組態,請參閱 Shell 啟動器 v2 的範例。
規格需求
Windows 10 企業版或Windows 10 教育版。
詞彙
開啟,啟用: 若要讓設定可供裝置使用,並選擇性地將設定套用至裝置。
配置: 若要自訂設定或子設定。
內嵌殼層啟動器:此功能在 Windows 10 1511 版中稱為內嵌殼層啟動器。
自訂殼層啟動器:此功能在 Windows 10 1607 版和更新版本中稱為殼層啟動器。
開啟殼層啟動器
殼層啟動器是選擇性元件,預設不會在 Windows 10 中開啟。 在設定之前,必須先開啟它。 如果尚未安裝 Microsoft Windows,您可以在自訂的 Windows 10 映射 (.wim) 中開啟和設定殼層啟動器。 如果已安裝 Windows,您必須先開啟殼層啟動器,才能套用布建套件來設定殼層啟動器。
使用 主控台 啟用殼層啟動器
在 [ 搜尋 Web 和 Windows ] 欄位中,輸入 [程式和功能 ],然後按 Enter 或點選或選取 [ 程式和功能 ] 加以開啟。
Shell 啟動器設定也可做為 Windows 布建設定,因此您可以設定要在映射執行時間期間套用這些設定。 您可以使用 Windows 組態Designer建立布建套件,然後在映射部署期間或執行時間套用布建套件,來設定一或所有殼層啟動器設定。 如果尚未安裝 Windows,而且您使用 Windows 組態Designer建立安裝媒體,其中包含映射中殼層啟動器的設定,或在安裝期間套用布建套件,您必須在安裝媒體上使用 DISM 啟用殼層啟動器,才能成功套用布建套件。
# Check if shell launcher license is enabled
function Check-ShellLauncherLicenseEnabled
{
[string]$source = @"
using System;
using System.Runtime.InteropServices;
static class CheckShellLauncherLicense
{
const int S_OK = 0;
public static bool IsShellLauncherLicenseEnabled()
{
int enabled = 0;
if (NativeMethods.SLGetWindowsInformationDWORD("EmbeddedFeature-ShellLauncher-Enabled", out enabled) != S_OK) {
enabled = 0;
}
return (enabled != 0);
}
static class NativeMethods
{
[DllImport("Slc.dll")]
internal static extern int SLGetWindowsInformationDWORD([MarshalAs(UnmanagedType.LPWStr)]string valueName, out int value);
}
}
"@
$type = Add-Type -TypeDefinition $source -PassThru
return $type[0]::IsShellLauncherLicenseEnabled()
}
[bool]$result = $false
$result = Check-ShellLauncherLicenseEnabled
"`nShell Launcher license enabled is set to " + $result
if (-not($result))
{
"`nThis device doesn't have required license to use Shell Launcher"
exit
}
$COMPUTER = "localhost"
$NAMESPACE = "root\standardcimv2\embedded"
# Create a handle to the class instance so we can call the static methods.
try {
$ShellLauncherClass = [wmiclass]"\\$COMPUTER\${NAMESPACE}:WESL_UserSetting"
} catch [Exception] {
write-host $_.Exception.Message;
write-host "Make sure Shell Launcher feature is enabled"
exit
}
# This well-known security identifier (SID) corresponds to the BUILTIN\Administrators group.
$Admins_SID = "S-1-5-32-544"
# Create a function to retrieve the SID for a user account on a machine.
function Get-UsernameSID($AccountName) {
$NTUserObject = New-Object System.Security.Principal.NTAccount($AccountName)
$NTUserSID = $NTUserObject.Translate([System.Security.Principal.SecurityIdentifier])
return $NTUserSID.Value
}
# Get the SID for a user account named "Cashier". Rename "Cashier" to an existing account on your system to test this script.
$Cashier_SID = Get-UsernameSID("Cashier")
# Define actions to take when the shell program exits.
$restart_shell = 0
$restart_device = 1
$shutdown_device = 2
$do_nothing = 3
# Examples. You can change these examples to use the program that you want to use as the shell.
# This example sets the command prompt as the default shell, and restarts the device if the command prompt is closed.
$ShellLauncherClass.SetDefaultShell("cmd.exe", $restart_device)
# Display the default shell to verify that it was added correctly.
$DefaultShellObject = $ShellLauncherClass.GetDefaultShell()
"`nDefault Shell is set to " + $DefaultShellObject.Shell + " and the default action is set to " + $DefaultShellObject.defaultaction
# Set Internet Explorer as the shell for "Cashier", and restart the machine if Internet Explorer is closed.
$ShellLauncherClass.SetCustomShell($Cashier_SID, "c:\program files\internet explorer\iexplore.exe www.microsoft.com", ($null), ($null), $restart_shell)
# Set Explorer as the shell for administrators.
$ShellLauncherClass.SetCustomShell($Admins_SID, "explorer.exe")
# View all the custom shells defined.
"`nCurrent settings for custom shells:"
Get-WmiObject -namespace $NAMESPACE -computer $COMPUTER -class WESL_UserSetting | Select Sid, Shell, DefaultAction
# Enable Shell Launcher
$ShellLauncherClass.SetEnabled($TRUE)
$IsShellLauncherEnabled = $ShellLauncherClass.IsEnabled()
"`nEnabled is set to " + $IsShellLauncherEnabled.Enabled
# Remove the new custom shells.
$ShellLauncherClass.RemoveCustomShell($Admins_SID)
$ShellLauncherClass.RemoveCustomShell($Cashier_SID)
# Disable Shell Launcher
$ShellLauncherClass.SetEnabled($FALSE)
$IsShellLauncherEnabled = $ShellLauncherClass.IsEnabled()
"`nEnabled is set to " + $IsShellLauncherEnabled.Enabled
This module describes how administrators can activate Windows clients at scale and use Group Policy and PowerShell to apply configuration settings to groups of Windows clients.