为什么Windows 10 Enterprise Shell Launcher会出现黑屏?

问题描述 投票:1回答:2

我在Virtual Box VM中使用Windows 10 Enterprise,Build 10586来尝试使用Windows 10创建一个自助服务终端。

自助服务终端模式应用程序是“cmd.exe”,现在作为测试。这适用于传统的.Net应用程序,而不是通用Windows应用程序。

我已经发现SO上的文章已经说明了如何做到这一点,我相信我已经正确地遵循了面包屑,但是在运行下面的脚本后我每次启动VM时都会出现黑屏:

$COMPUTER = "localhost"
$NAMESPACE = "root\standardcimv2\embedded"
$ACCOUNT_NAME = "Fred"

$ShellLauncherClass = [wmiclass]"\\$COMPUTER\${NAMESPACE}:WESL_UserSetting"


$NTUserObject = New-Object System.Security.Principal.NTAccount($ACCOUNT_NAME)
$NTUserSID = $NTUserObject.Translate([System.Security.Principal.SecurityIdentifier]).Value

$NTUser_Shell = Get-WmiObject -namespace $NAMESPACE -computer $COMPUTER -class WESL_UserSetting | 
    where {$_.Sid -eq $NTUserSID}

if ($NTUser_Shell) {
    "`Custom shell already set for [$ACCOUNT_NAME] removing it"
    $ShellLauncherClass.RemoveCustomShell($NTUserSID)
}

$restart_shell = 0
$restart_device = 1
$shutdown_device = 2

$ShellLauncherClass.SetCustomShell($NTUserSID, "cmd.exe", ($null), ($null), $restart_device)

"`nCurrent settings for custom shells:"
Get-WmiObject -namespace $NAMESPACE -computer $COMPUTER -class WESL_UserSetting | Select Sid, Shell, DefaultAction

$ShellLauncherClass.SetEnabled($TRUE)
#$ShellLauncherClass.SetEnabled($FALSE)

""
"Enabled is set to " + $ShellLauncherClass.IsEnabled().Enabled

当我在Powershell中运行脚本时(作为管理员),一切看起来都正确(见下文)。

enter image description here

当我重新启动并使用任何帐户(管理员或非管理员)登录时,我得到一个非交互式黑屏(即只是黑屏,而不是命令提示符)。

任何帮助将不胜感激。

windows shell powershell kiosk kiosk-mode
2个回答
0
投票

看起来您可能在未启用该功能的情况下启用了Shell启动程序,或启用了该功能,启用了Shell启动程序,然后禁用了该功能。尝试运行Powershell脚本:

# To Get Optional Features   -online means the running copy of Windows
# Get-WindowsOptionalFeature -online

# the -all says enable all features required by the feature to be added
Enable-WindowsOptionalFeature -online -FeatureName Client-EmbeddedShellLauncher -all

0
投票

转到HKLM \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ System并将DWORD值EnableLUA设置为0

© www.soinside.com 2019 - 2024. All rights reserved.