How to run an application as shell replacement on Windows 10 Enterprise

前端 未结 8 588
攒了一身酷
攒了一身酷 2020-12-24 03:25

I need to create a special account on a computer running Windows 10 Enterprise. This account would launch an application directly on login instead of the default shell and e

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-24 04:18

    I ran into the same issue, and that's because the Script from TechNet on how to configure ShellLauncher actually enables, then disables the same Shell!

    # 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
    

    I was lazily just copying and pasting the code and expected it to work.

    If you comment out the final ten lines, this process will work.

    Remember Kids: don't just copy and paste code from Strangers!

提交回复
热议问题