gpt4 book ai didi

windows - 如何在 Windows 10 企业版上运行应用程序作为 shell 替换

转载 作者:可可西里 更新时间:2023-11-01 12:15:47 25 4
gpt4 key购买 nike

我需要在运行 Windows 10 企业版的计算机上创建一个特殊帐户。此帐户将在登录时直接启动应用程序而不是默认 shell,退出应用程序应强制计算机重新启动。

我能够使用配置控制台和锁定功能在 Windows 8.1 Embedded Industry Pro 上轻松完成此操作。

现在,在 Windows 10 上,我尝试遵循 technet 上的两个教程 WESL_UserSettingSet up a kiosk on Windows 10 Pro, Enterprise, or Education

但是,这两个教程都不起作用。我设法执行了其中描述的脚本,但它们没有任何效果(我修改了它们,因此它们不会删除 shell 集)。

最后我得到了以下代码:

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

$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

在管理员 powershell 中执行此脚本会产生所需的输出:

Custom shell already set for [cmp] removing it

Current settings for custom shells:

Sid Shell DefaultAction
--- ----- -------------
S-1-5-21-3842421150-1098587697-2315725148-1002 cmd.exe 1

然而,以“cmp”用户身份登录只会显示标准的 Windows 10 shell。

为了能够运行程序而不是标准 shell,我应该更改什么?

最佳答案

我现在遇到了同样的问题。是的,Microsoft 已经改变了更换 shell 的方式。您可以安装和使用 Embedded Shell Launcher,根据您的喜好为 kiosk 模式自定义窗口。但这仅适用于企业和教育。

如果您不想购买企业版,您可以使用 HKCU 和 HKLM 中已知的注册表位置。 https://msdn.microsoft.com/en-us/library/ms838576(v=WinEmbedded.5).aspx

但是等等,哦不,因为 Windows 10 只能使用 Microsoft 签名的应用程序,所以您的普通 .net 应用程序不会启动,并且在登录后屏幕一直是黑色的。但我们已经找到了解决方法。

只需使用批处理文件作为引导。如果您将您喜欢的注册表项设置为批处理文件,并且批处理文件启动了真正的应用程序,那么它就像一个魅力。

@echo off
echo Bootstrapping, please wait ...
start /b "Bootstrap" "C:\vmwatcher\VMViewClientWatcher.exe"

关于windows - 如何在 Windows 10 企业版上运行应用程序作为 shell 替换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33364908/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com