How do I replace the system shell (explorer.exe) with another process in Windows 10?
Solution 1:
This is stored in the key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
Replace this with whatever you want, but the software it loads in place will then need to provide a way to log out/shut down/restart the machine, or you'll need to use Task Manager to do so.
Solution 2:
This is how I've been doing it for years, from Windows NT4 on to Windows 10 and Server 2019.
It is best to change Windows Explorer's settings to show file extensions, so you don’t select ‘ntuser.dat.log’ or ‘ntuser.ini’ or another wrong file below.
- Create a new user, let’s say ‘Test’.
- Log on as that user, so the first logon agent is executed, creating the profile directory and registry hive.
Log off again, and log back into your normal account (or any account that is member of the Administrators group). - Make sure the user account you just logged out of is not logged in – neither at the console, nor remote desktop, nor any scheduled tasks that may be active under this account, during the remainder of this procedure.
- Open regedit, and select HKEY_USERS.
- Menu File / Load Hive.
Navigate to C:\Users\{new user name} -- C:\Users\Test in my example
Select the file ‘NTUSER.DAT’ and load it. - You will be prompted to enter a key name. Just invent one, the user’s registry hive will be loaded under that name as a new branch in HKEY_USERS. I used ‘Test’ here.
- Go to HKEY_USERS\Test\Software\Microsoft\Windows NT\CurrentVersion\Winlogon
Create a new String value, named Shell.
Set it to the application you want to start instead of the normal Windows shell.
Specify the full path, make no assumptions about PATH environment variables etc., as far as I could figure out there is no environment yet when Windows reads this key.
I used ‘C:\Windows\system32\cmd.exe’ in the example below.
This works with explorer.exe without path, so I think Windows will search the C:\Windows directory – but I’m not sure, because it will also launch explorer.exe if you leave the setting empty or specify a non-existing file. -
Important
Now go back to HKEY_USERS\Test, and unload that hive (menu File / Unload Hive, and confirm).
If you skip this step and leave it loaded, the entire user profile including its registry hive will be re-created under a new name (C:\Users\Test.1 or similar) the next time you log on as that user, and your changes will be lost.
Windows 10 and later Server systems seem to be more permissive here than older versions, but I would take no risk. - Now just log off, and log on as Test.
This is how the result looks in the Server 2019 VM under VMWare where I just ran through this procedure to make sure I skipped no steps:
Some things to keep in mind when you create your shell program:
- Your custom shell will start in C:\Windows\system32\ as working directory, even if your exe is located somewhere else.
If you created a plain user account (non-admin), it will not have write access there, so best 'cd' to somewhere else early, if you expect your app to write log files or so in its working directory. - When your application exits (or crashes), it will not log you out – you’ll be left with an empty black screen.
In cmd.exe, for example, log off by issuing the ‘logoff’ command (C:\Windows\system32’\logoff.exe). - Some functionality you may expect to be available in a custom app you wrote in C# or so, will not work because it is provided by explorer.exe.
It may not work and just give an error, or it may launch explorer.exe. - If you launch explorer.exe (for example by typing ‘explorer’ at the command prompt in the example), the first instance will not show up as the explorer window you would expect. The normal Windows desktop, task bar etc. will appear instead.
- Don’t think users will never discover ways to still get to the classic desktop, even if you block ctrl+alt+del or delete the task manager executable.
One trick users of my kiosk app discovered > 20 years ago, way back under Windows NT4: remove all paper from the printer, and start a print job from within my app. The "out of paper" error message that was issued by the (HP) printer driver contained a Help button. In the help file that opened, one of the pages contained a link to open the Printers control panel. Control panel is just another instance of explorer.exe. A bit later, shop attendants were browsing the web on the kiosk.