如何在Windows 10 Enterprise上运行应用程序作为shell替换

前端之家收集整理的这篇文章主要介绍了如何在Windows 10 Enterprise上运行应用程序作为shell替换前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我需要在运行Windows 10 Enterprise的计算机上创建一个特殊帐户.该帐户将直接在登录时启动应用程序,而不是默认的shell,并退出应用程序应强制重新启动计算机.

我可以在Windows 8.1 Embedded Industry Pro上使用配置控制台和锁定功能轻松实现.

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

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

最后我结束了以下代码

  1. $COMPUTER = "localhost"
  2. $NAMESPACE = "root\standardcimv2\embedded"
  3. $ACCOUNT_NAME = "cmp"
  4.  
  5. $ShellLauncherClass = [wmiclass]"\\$COMPUTER\${NAMESPACE}:WESL_UserSetting"
  6.  
  7.  
  8. $NTUserObject = New-Object System.Security.Principal.NTAccount($ACCOUNT_NAME)
  9. $NTUserSID = $NTUserObject.Translate([System.Security.Principal.SecurityIdentifier]).Value
  10.  
  11. $NTUser_Shell = Get-WmiObject -namespace $NAMESPACE -computer $COMPUTER -class WESL_UserSetting |
  12. where {$_.Sid -eq $NTUserSID}
  13.  
  14. if ($NTUser_Shell) {
  15. "`Custom shell already set for [$ACCOUNT_NAME] removing it"
  16. $ShellLauncherClass.RemoveCustomShell($NTUserSID)
  17. }
  18.  
  19. $restart_shell = 0
  20. $restart_device = 1
  21. $shutdown_device = 2
  22.  
  23. $ShellLauncherClass.SetCustomShell($NTUserSID,"cmd.exe",($null),$restart_device)
  24.  
  25. "`nCurrent settings for custom shells:"
  26. Get-WmiObject -namespace $NAMESPACE -computer $COMPUTER -class WESL_UserSetting | Select Sid,Shell,DefaultAction

在admin powershell中执行此脚本会产生所需的输出

  1. Custom shell already set for [cmp] removing it
  2.  
  3. Current settings for custom shells:
  4.  
  5. Sid Shell DefaultAction
  6. --- ----- -------------
  7. S-1-5-21-3842421150-1098587697-2315725148-1002 cmd.exe 1

但是,“cmp”用户只需显示标准的Windows 10 shell即可.

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

你试过改变用户shell吗?

https://msdn.microsoft.com/en-us/library/ms838576(v=WinEmbedded.5).aspx

您需要设置几个注册表项.第一个能够给用户一个唯一的shell,第二个定义了可执行文件,而不是浏览器.

猜你在找的Windows相关文章