Why Userinit Entry Triggers an Infinite Loop After a Group Policy Edit
🔍 WiseChecker

Why Userinit Entry Triggers an Infinite Loop After a Group Policy Edit

After editing a Group Policy Object that modifies the Userinit registry entry, you may find that Windows 11 restarts repeatedly or enters a boot loop. This happens because the Userinit value controls which processes run at user logon. If the path is corrupted, duplicated, or points to a nonexistent executable, the logon process fails and restarts in a cycle. This article explains the exact registry path involved, why the loop occurs, and how to break the cycle using Safe Mode and the Registry Editor.

Key Takeaways: Fixing the Userinit Infinite Boot Loop on Windows 11

  • Registry path HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit: The exact location where Group Policy edits can cause a loop if the value is malformed.
  • Safe Mode with Command Prompt: The only way to access the system when normal boot fails; use Shift+F8 or the recovery environment to enter it.
  • Correct Userinit value format: Must be a comma-separated list of full paths to executables, starting with C:\Windows\system32\userinit.exe, with no trailing comma or space.

ADVERTISEMENT

Why the Userinit Registry Entry Causes an Infinite Loop After a Group Policy Edit

The Userinit registry entry is located under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon. This key tells Windows which programs to launch immediately after a user logs on. The default value is C:\Windows\system32\userinit.exe,. The comma at the end is intentional — it allows additional programs to be appended.

When you edit a Group Policy Object that targets this value, the policy may overwrite the entry with an incorrect path, a duplicate path, or a path to a program that does not exist. Common errors include:

  • Removing the comma separator, causing Windows to treat the entire string as a single filename.
  • Adding a trailing space or semicolon instead of a comma.
  • Pointing to a 32-bit executable on a 64-bit system without the correct SysWOW64 path.

Because userinit.exe is responsible for starting the shell and the logon UI, a broken entry prevents the desktop from loading. Windows detects the failure, restarts the logon process, and the cycle repeats indefinitely.

Steps to Break the Infinite Boot Loop and Restore the Userinit Entry

To fix this issue, you must boot into Safe Mode or the Windows Recovery Environment, then edit the registry manually. Follow these steps in order.

Step 1: Enter the Windows Recovery Environment

  1. Force a shutdown
    Press and hold the physical power button on your device for 10 seconds until the system turns off completely. Repeat this three times. On the third restart, Windows will display the Automatic Repair screen.
  2. Open Advanced options
    On the Automatic Repair screen, click Advanced options. This opens the Windows Recovery Environment.
  3. Navigate to Safe Mode
    Select Troubleshoot > Advanced options > Startup Settings > Restart. After the system restarts, press 4 or F4 to enable Safe Mode. If you need Command Prompt access, press 6 or F6 to enable Safe Mode with Command Prompt.

Step 2: Open the Registry Editor

  1. Launch Registry Editor
    Press Win + R, type regedit, and press Enter. If you are in Safe Mode with Command Prompt, type regedit at the command prompt and press Enter.
  2. Navigate to the Userinit key
    In the left pane, expand the following path:
    HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows NT > CurrentVersion > Winlogon
  3. Locate the Userinit value
    In the right pane, double-click the Userinit string value. If you do not see it, the entry may have been deleted. In that case, right-click an empty space, select New > String Value, name it Userinit, and then double-click it to edit.

Step 3: Correct the Userinit Value

  1. Set the default value
    In the Value data field, type exactly the following and click OK:
    C:\Windows\system32\userinit.exe,
  2. Verify no extra characters exist
    Ensure there is no space before or after the comma. Do not add a second comma or any other delimiter.
  3. Add additional programs if needed
    If your organization requires additional startup programs, append them after the comma with a full path. For example:
    C:\Windows\system32\userinit.exe, C:\Program Files\SomeApp\app.exe
    Separate each additional program with a comma and a space. Do not use semicolons.

Step 4: Exit Safe Mode and Restart Normally

  1. Close Registry Editor
    Click File > Exit.
  2. Restart the system
    Press Win + X, select Shut down or sign out > Restart. In Safe Mode with Command Prompt, type shutdown /r /t 0 and press Enter.
  3. Test normal boot
    If the Userinit value was the only problem, Windows 11 should now boot to the desktop without looping.

ADVERTISEMENT

Related Failure Patterns and Additional Fixes

Windows 11 Boots to Black Screen After Group Policy Edit

If the Userinit value is missing entirely or set to an empty string, Windows may show a black screen with a cursor. The fix is the same: boot into Safe Mode and restore the default Userinit value as described above. If the black screen persists, also check the Shell value in the same registry key. The default Shell value should be explorer.exe.

Infinite Loop Only Occurs After Applying a Specific GPO

If the loop started immediately after applying a Group Policy Object, the GPO itself may be corrupt or misconfigured. On a domain controller or local machine, run gpresult /h gpresult.html from an elevated Command Prompt to export the applied policies. Review the HTML file for any policy that sets the Userinit value. Remove or correct that policy using the Group Policy Management Console.

Boot Loop Persists After Fixing Userinit

If the loop continues, other registry entries may have been altered. Check the following keys for similar corruption:

  • HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell — should be explorer.exe
  • HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\BootExecute — should be autocheck autochk

If you are unsure of the default values, compare them with a working Windows 11 installation or a known-good backup of the registry.

Item Correct Userinit Value Common Incorrect Value
Base path C:\Windows\system32\userinit.exe, C:\Windows\system32\userinit.exe
Trailing delimiter Single comma, no space Semicolon, space, or no delimiter
Additional entries Comma-separated full paths Relative paths or missing commas
Architecture mismatch SysWOW64 for 32-bit apps on 64-bit OS Using system32 for 32-bit apps on 64-bit OS

You can now identify and fix a Userinit infinite loop caused by a Group Policy edit. After correcting the registry entry, the system should boot normally. To prevent future loops, always test Group Policy changes on a non-production system first. For advanced protection, enable Registry Editor auditing via Local Security Policy > Advanced Audit Policy Configuration > Object Access > Audit Registry to log all changes to the Winlogon key.

ADVERTISEMENT