How to Launch a Program Before the Shell at Logon

Article translations Article translations
Article ID: 142905 - View products that this article applies to.
This article was previously published under Q142905
Expand all | Collapse all


This article explains how to avoid interaction between a program and the standard shell by running the program before the shell starts.


When you log on, the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlog

describes the actions made by WinLogon.

The Userinit value describes the program launched by WinLogon.

   Userinit:      REG_SZ

The first entry (USERINIT) is responsible for executing the shell program. To start your program before the shell, you may replace this entry with your own program. If you do so, your application is responsible for launching the shell (Explorer.exe in Windows NT 4.0).

Explorer.exe is the standard shell in Windows NT 4.0. It can operate in two modes:
  • Browser mode (similar to File Manager)
  • Shell mode (to manage the desktop, taskbar, and Start button)
When you launch Explorer.exe, the following conditions are checked by Explorer.exe to work in shell mode:
  1. No instances of Explorer.exe are running
  2. It is the standard shell for the system (see shell registry value under
WinLogon key)

If you launch Explorer.exe from your own "userinit" initialization program, be sure that the shell value always references Explorer.exe, otherwise Explorer.exe will operate in browser mode instead of shell mode.


Article ID: 142905 - Last Review: October 31, 2006 - Revision: 3.1
  • Microsoft Windows NT Server 4.0 Standard Edition
  • Microsoft Windows NT Workstation 4.0 Developer Edition
kbui KB142905

Give Feedback


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from