Original publish date: June 18, 2026
KB ID: 5105752
Symptoms
JScript global definitions and execution context loaded from multiple scripts or provided through polyfills might not persist after each script finishes running. As a result, some scripts that worked in earlier versions of Windows might fail in Windows 11, version 24H2 and later.
Cause
The jscript9legacy.dll is a dynamic link library (DLL) file used in Windows operating systems, particularly for running JScript code. This DLL is a newer version that replaces the older jscript9.dll to address various vulnerabilities and improve security, starting in Windows 11, version 24H2.
The older jscript9.dll automatically retains global definitions and context, so functions loaded from multiple scripts remain accessible. In jscript9legacy.dll, the execution context does not persist by default. Functions defined in one script are discarded after execution and are not accessible to the rest of the script.
Resolution
This issue is addressed in Windows updates released on and after February 24, 2026 (KB5077241). However, the feature that resolves the issue is disabled by default. To enable persistent JScript execution context, follow these steps.
Important: This article contains information about how to modify the registry. Make sure that you back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, see How to back up and restore the registry in Windows.
-
Run the following command to create the feature control registry key:
reg add "HKLM\Software\Policies\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ENABLE_PERSISTENCE"
-
Under this key, create a new DWORD (32-bit) value.
-
Configure the value as follows:
-
To enable persistence for specific processes only: Set the value to 1 for each target process name.
-
To enable persistence for all processes: Add * as the key name and set its value to 1.
-