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

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

提交回复
热议问题