Daily MaverickNOD TO SUPPORTERS: Promise of more tickets for Newlands Test after public outcryInquirerKasadyaan parade lights up Dumaguete streetsPunchTinubu approves new NNPC refinery for EdoInquirer EntertainmentCalista relaunches as four-member group with new single ‘Vendetta’한겨레‘겨울철 별미’의 속사정 [유레카]UOLMineradora suspende projeto no Paquistão após morte de 8 refénsالنهاربعد 11 عاماً من الغياب... استقبالٌ حاشد لعمر الشغري في بلدته بريف بانياسANSA SportMondiali nuoto 25m: staffetta 4x100 mista femminile in finale col primato italianoZDF heuteStart-up statt Einstiegsjob: Gründen boomt bei den JungenObservador DesportoAviso amarelo para Bragança e Guarda devido ao nevoeiroThe Sydney Morning HeraldStruggling to catch the lightSRF NewsKrieg im Nahen Osten – Israel: Militärchef der Hamas in Gaza getötet
betaThe Daily Newsstand · Free, Always
Sunday, December 6, 2026
Automatic translation is active. Articles in other languages will open in English.Enable automatic translation of articles from other languages into English.

Start Menu Stops Working on Some Windows 11 PCs Using Codex, With .NET PATH Entries a Possible Cause

The article's text, from Joho no Todai's page.

Translate

A Windows 11 user described how they restored the Start menu and search.

They tried to drag an app from the search results to the desktop, and search stopped completing. The Start menu and Settings eventually stopped opening too. The user was unsure whether dragging the app had triggered the issue.

File Explorer still worked, and right-clicking Start still opened its menu. A new local account on the same PC worked normally. A Windows repair install from an ISO did not fix the affected account, according to the report.

The new account working points to per-user settings. Looking at those settings can help before trying another repair install.

PowerShell showed 805 characters and 47,067 characters

During the investigation, using PowerShell with Start-Process -UseNewEnvironment to launch sihost.exe returned EnvironmentBlockTooLong. An earlier 0xC0000017 error had suggested insufficient memory, but committed memory stood at 29 GB against a 101.7 GB limit.

The user examined PATH, the environment variable listing directories to search for executables. They got two values in PowerShell.

  • Length of the PATH configured for the user account: [Environment]::GetEnvironmentVariable('Path', 'User').Length
  • Length of the PATH in the current PowerShell process: $env:Path.Length

The first was 47,067 characters, while the second was 805. Both commands check the length without changing settings. References to other environment variables can be expanded when reading the user value, so it may differ in length from the unexpanded string in the registry.

Microsoft’s environment variable documentation gives 32,767 characters as the maximum size of a user-defined environment variable. Windows Vista and later impose no technical limit on the environment block as a whole, and practical limits vary by how it is accessed. The value retrieved exceeded the documented maximum for an individual variable.

Windows has settings per account and settings that apply system-wide. Each running process has its own environment variables too. By default, child processes inherit these values from their parents.

The value of 805 alone might have ended the PATH investigation. Checking the user setting uncovered a strong lead in a case the repair install had not resolved.

400 development directories in the user PATH

Why did the retrieved PATH contain 47,067 characters? The user found that of 408 nonempty entries, 400 pointed to .NET tools directories.

These directories came from development tasks done with OpenAI’s Codex, and 375 were from one viewer project. Each run used a different directory name, so removing exact duplicates barely reduced the length, the user said.

A similar failure appeared in Codex issue #64662. The user ran Windows 11 build 26200.9974 and Codex desktop app version 26.1120.50957 and had assigned .NET development and testing to multiple AI agents.

The Start menu and search stopped loading correctly, and unrelated apps also failed to open. DISM, which is used to repair Windows, returned an error. The user found that the registry’s user PATH had reached 31,783 characters, and PATH was empty in Command Prompt.

Temporarily fixing PATH in Command Prompt let DISM run. The user backed up the user PATH and removed entries for tool directories created by development tasks, reducing it to 167 characters.

The failure occurred even though the registry value was below the documented maximum of 32,767 characters. The length of the stored value alone is a poor guide to whether it will work.

Why temporary .NET environments can grow PATH

A report in .NET SDK issue #56512 describes temporary .NET environments created on each run during testing with Codex and Anthropic’s Claude Code. Tool directories from those environments kept being added to the user PATH.

Another user, on .NET SDK 8.0.422, said the user PATH reached 32,744 characters and contained 316 .NET tool directories that no longer existed. Removing only the unnecessary entries brought it down to 725 characters, and Windows features worked again after a restart.

One variable involved is DOTNET_CLI_HOME. It tells the Microsoft .NET SDK where to store files it needs to run commands and markers that track whether first-run steps have already executed.

The published .NET SDK 8.0.422 source shows that if adding global tools to PATH is enabled and the registration marker is absent, the SDK calls the registration code and creates the marker. On Windows, the code checks for the target directory in PATH and appends it to the user PATH if missing.

Running the SDK with a fresh DOTNET_CLI_HOME for each test changes both the tools directory and where the marker is stored. Each run that meets the conditions can add a persistent entry for a temporary directory. The registration code has no branch to remove old temporary directories or check PATH length before appending.

Temporary development environments are meant to isolate state for each task. The setting used to create that isolation can end up growing a variable shared by the whole account.

The report with the 47,067-character PATH did not give the exact SDK command or version, so some steps leading to that particular failure are unclear. The SDK code explains the PATH growth other users described. The same concern applies to development workflows outside Codex that repeatedly create temporary home directories.

Restoring needed PATH entries from a backup

The first user ran reg.exe export HKCU\Environment "$env:USERPROFILE\Environment-before-fix.reg" in PowerShell to back up the user environment variables stored in the registry. They temporarily set only the user PATH to a short value, leaving the system PATH alone. The Start menu and search worked after a full sign-out and sign-in.

They then recovered required directories for Visual Studio Code, npm, LM Studio, .NET global tools, and others from the backup, leaving the user PATH about 375 characters long.

For similar symptoms in Windows 11, start by checking both the user PATH and the process PATH. The original reporter cautioned against replacing a PATH of normal length based on the symptoms alone.

A backup can preserve required development tool settings. This user could shorten the long PATH and recover the entries they needed.

How to disable automatic registration by the SDK

Microsoft’s official .NET environment variable documentation lists DOTNET_ADD_GLOBAL_TOOLS_TO_PATH. It defaults to true. Setting it to false disables the SDK’s automatic addition of global tools to PATH.

For .NET development or tests that use temporary home directories, pass the setting to the process that actually launches the SDK to disable automatic registration. If launching the SDK directly in PowerShell, set $env:DOTNET_ADD_GLOBAL_TOOLS_TO_PATH = 'false' in the current session. This also affects automatic registration of regular global tools, so required tool directories must be managed separately. Entries already accumulated in PATH still require cleanup.

Related Codex issue #46374 describes disabling registration as a user environment setting, only for a test program created during development to filter the environment passed to child processes. The SDK never received the setting.

Check that the setting reaches the SDK when launched by programs generated during AI-assisted development. Checks for user PATH changes after repeated builds and tests can help prevent the same problem.

Keeping project settings within the project

.NET can manage tools per project. When the installation directory is specified with --tool-path, the SDK does not automatically add that directory to PATH. Tools can be run by specifying their directory.

Local tools are another option. List the project’s tools in a manifest, use dotnet tool restore to restore them, and use dotnet tool run to launch them. Managing tools per project reduces the need for permanent changes to the user PATH.

PowerShell can also constrain environment changes to the current session. Keeping changes within the process doing the work limits their impact compared with changing account-wide settings.

If AI agents are setting up environments, project-specific tools should stay within the scope of the work wherever possible. Persistent configuration changes should come with a reason and a record of the settings before and after. The SDK should put limits on account-wide changes from temporary environments. AI agents also have a role in detecting and preventing the system-wide effects of repeated development tasks.

Checking that an app works is an obvious part of development. Does success also mean being able to use the same PC normally after the work is done?

View the original on Joho no Todai →