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

前端 未结 8 553
攒了一身酷
攒了一身酷 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:25

    My fist attempt to help where I have received much. Not a complete answer, but maybe enough to get you to your destination. This worked on my "Kiosk" app which is on "my" Windows 10 Enterprise system which was built specifically for my app. It will set your "shell" to start on system startup and then start your click once program. Hope this helps.

    Imports System.Threading
    
    Public Class Form1
    
    # Path to your ClickOnce app
    Dim startPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Programs) _
    & '"\"' & '"remaining path to your app"' & '".appref-ms"'
    
    # Path to your shell which is also a clickonce app(this one)
    
    Dim spath As String = Application.StartupPath & '"\"' & My.Application.Info.AssemblyName _
    & '".exe"'
    
    # This sets the registry to start your shell which in turn starts your app. 
    # I did this so that if the app is closed, they see the shell background.
    # You can add controls to your shell to restart the app, shutdown.... 
    #Just be cautious, make sure your app is 100% done and updates on it's own before you 
    # disable the ability to get back to windows explorer.
    # Other wise you could have a very bad day.
    
    My.Computer.Registry.SetValue('"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\ _
    CurrentVersion\Winlogon"', '"Shell"', spath)
    
    
    Thread.Sleep(500)
    
    Process.Start(startPath)
    
    End Class
    
    0 讨论(0)
  • 2020-12-24 04:26

    I think you set up correctly the custom shell for the user, but maybe you need to activate the ShellLanuncher behaviour. Try this (at the end of your script):

    $ShellLauncherClass.SetEnabled($TRUE)
    

    This way the standard windows 10 shell is not launched when you log on with the other account, but (at least in my case) the command line does not start and the result is a black screen.

    You can still run the task manager and run a new task from there, but I don't understand why the command line does not automatically start.

    0 讨论(0)
提交回复
热议问题