Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A Windows Script Host error can come from the script, a missing dependency, permissions, Outlook security settings, or the host that launched it. On Windows 11 versions 24H2 and 25H2, a documented JScript execution-context issue can also cause functions or global definitions to be unavailable across scripts. Identify the exact error and script type before changing settings.

Record the message, the file extension (.js, .jse, .vbs, or .vbe), and the program that launched it. The right fix depends on those details.

1. Check your Windows 11 version and the script type

Press Win + R, type winver, and press Enter. Microsoft documents the JScript execution-context issue on Windows 11 versions 24H2 and 25H2, across all editions.

Check the script extension:

Extension Typical engine What it helps identify
.js or .jse JScript Relevant to the 24H2/25H2 execution-context issue
.vbs or .vbe VBScript May be affected by optional-feature settings and deprecation

Windows Script Host has not been removed from Windows 11 24H2. Microsoft says VBScript remains enabled by default as an optional feature in that release.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Lexar D40E 128GB Dual USB 3.2 Gen 1 Type-C Jump Drive, Champagne Silver
  • USB-C 2-in-1 storage OTG: The Lexar JumpDrive Dual Drive D40E features USB Type-A and Type-C connectors in a slim, portable form factor for easy device compatibility
  • Transfer speeds up to 100MB/s: Based on internal testing, performance may vary depending upon the host device, interface, and usage conditions. 1MB=1,000,000 bytes
  • Plug and Play: Widely compatible with USB Type-C smartphones, tablets, laptops, Macs, and traditional Type-A devices, no software installation required. The 360° swivel design allows for easy switching between connectors without the hassle of losing a cap
  • Durable & Compact: The Lexar D40E USB memory stick features a metal enclosure, withstands temperatures from 0° to 50° C (32°F to 122°F), and is lightweight at 26g with dimensions of 70.4 x 16.9 x 11.7mm
  • Security & Warranty: Securely protects files using an advanced security software solution with 256-bit AES encryption. Backed by a Lexar 3-year limited warranty

2. Run the script from Command Prompt to see the real error

A double-click may show only a short dialog. Running the file from a console can reveal a line number, error, or missing file.

  1. Open Start, search for Command Prompt, and select Run as administrator if the script needs elevated rights.
  2. For a JScript file, run: cscript //nologo “C:\Path\to\script.js”
  3. For a VBScript file, run: cscript //nologo “C:\Path\to\script.vbs”
  4. To test the graphical host, run: wscript “C:\Path\to\script.js”

If cscript reports a syntax error, the script itself is a likely cause. If it reports a missing file, component, or permission, repair that dependency or run the script from its intended working directory. If it works with cscript but not when double-clicked, investigate the graphical host, file association, or launching application.

3. Install the Windows update for the JScript persistence problem

Beginning with Windows 11 version 24H2, relevant JScript execution uses jscript9legacy.dll instead of the older jscript9.dll. The newer implementation does not preserve execution context by default in the same way, so a function or global definition loaded by one script may be unavailable when another script runs.

Microsoft says the issue is addressed by Windows updates released on or after February 24, 2026, including KB5077241. Install the latest available cumulative update rather than relying on an older standalone package.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Open Settings > Windows Update.
  2. Select Check for updates.
  3. Install available updates and restart Windows.
  4. Test the script again from Command Prompt.

Installing the update alone may not enable the compatibility behavior. Microsoft says persistent JScript execution context is disabled by default and must also be enabled in the registry when the affected script requires it.

4. Enable persistent JScript execution context when required

Back up the registry or create a restore point before changing it. Open Command Prompt as administrator and create the feature-control key with this command: reg add “HKLM\Software\Policies\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ENABLE_PERSISTENCE” /f

Enable the feature for a particular process by creating a DWORD (32-bit) value named for that executable and setting it to 1. For Windows Script Host, for example, run: reg add “HKLM\Software\Policies\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ENABLE_PERSISTENCE” /v wscript.exe /t REG_DWORD /d 1 /f

Rank #2
SANDISK 128GB Ultra Flair, USB-A Flash Drive, Up to 150MB/s Read Speeds
  • High-speed USB 3.0 performance of up to 150MB/s(1) [(1) Write to drive up to 15x faster than standard USB 2.0 drives (4MB/s); varies by drive capacity. Up to 150MB/s read speed. USB 3.0 port required. Based on internal testing; performance may be lower depending on host device, usage conditions, and other factors; 1MB=1,000,000 bytes]
  • Transfer a full-length movie in less than 30 seconds(2) [(2) Based on 1.2GB MPEG-4 video transfer with USB 3.0 host device. Results may vary based on host device, file attributes and other factors]
  • Transfer to drive up to 15 times faster than standard USB 2.0 drives(1)
  • Sleek, durable metal casing
  • Easy-to-use password protection for your private files(3) [(3)Password protection uses 128-bit AES encryption and is supported by Windows 7, Windows 8, Windows 10, and Mac OS X v10.9 plus; Software download required for Mac, visit the SanDisk SecureAccess support page]

If the script runs with the console host, add the corresponding value for cscript.exe: reg add “HKLM\Software\Policies\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ENABLE_PERSISTENCE” /v cscript.exe /t REG_DWORD /d 1 /f

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The value name must match the process that actually hosts the script. A process-specific value does not enable persistence for every script host.

To enable the setting for all processes, create a DWORD value named * and set it to 1: reg add “HKLM\Software\Policies\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ENABLE_PERSISTENCE” /v “*” /t REG_DWORD /d 1 /f

Use the wildcard cautiously because it applies to every process. Restart the affected application, or restart Windows, before testing again.

5. Check whether VBScript is enabled

If the error involves a .vbs or .vbe file, check the VBScript optional feature:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Open Settings > System > Optional features.
  2. Look through installed features for VBScript.
  3. If it is absent, select View features, search for VBScript, select it, and install it.
  4. Restart the application that runs the script and test again.

Microsoft is phasing out VBScript in three stages. In Windows 11 24H2 it is enabled by default as an optional feature. Around 2027 it is expected to be disabled by default, and a later Windows release is expected to remove the ability to re-enable it. This schedule applies to VBScript generally; it is separate from the JScript persistence issue.

6. Fix Windows Script Host errors caused by Classic Outlook forms

If the message appears while opening or using a custom form in Classic Outlook, changing Windows Script Host settings alone may not solve it. Outlook has separate security controls.

Rank #3
2 Pack 64GB USB Flash Drive USB 2.0 Thumb Drives Jump Drive Fold Storage Memory Stick Swivel Design - Black
  • What You Get - 2 pack 64GB genuine USB 2.0 flash drives, 12-month warranty and lifetime friendly customer service
  • Great for All Ages and Purposes – the thumb drives are suitable for storing digital data for school, business or daily usage. Apply to data storage of music, photos, movies and other files
  • Easy to Use - Plug and play USB memory stick, no need to install any software. Support Windows 7 / 8 / 10 / Vista / XP / Unix / 2000 / ME / NT Linux and Mac OS, compatible with USB 2.0 and 1.1 ports
  • Convenient Design - 360°metal swivel cap with matt surface and ring designed zip drive can protect USB connector, avoid to leave your fingerprint and easily attach to your key chain to avoid from losing and for easy carrying
  • Brand Yourself - Brand the flash drive with your company's name and provide company's overview, policies, etc. to the newly joined employees or your customers

For 32-bit Office on 64-bit Windows, use this registry location: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Office\16.0\Outlook\Security

For 64-bit Office on 64-bit Windows, or 32-bit Office on 32-bit Windows, use: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\16.0\Outlook\Security

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Office version number may differ: Outlook 2013 uses 15.0, Outlook 2010 uses 14.0, and Outlook 2007 uses 12.0. In the appropriate Security key, create or edit a DWORD (32-bit) value named DisableCustomFormItemScript and set it to 0. Microsoft documents the default value as 1, which blocks custom form scripts.

You must also trust the form’s message class. In the matching Office registry branch, create the key Outlook\Forms\TrustedFormScriptList. Inside it, create a REG_SZ value for each permitted form message class. For example, use the name IPM.Note.Custom and leave its data empty.

Restart Outlook after changing this list. During design, Run This Form checks the base form’s message class. After publication, Outlook checks the published custom message class. If you added the standard IPM.Note entry only for testing, remove it after the custom form is published if it is no longer needed.

For forms in secondary mailboxes or Public folders, open File > Options > Trust Center > Trust Center Settings > Email Security. Under Script in Folders, select Allow script in shared folders and, where required, Allow script in Public folders. Select OK, then OK again.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

7. Switch the console host only for console compatibility problems

Since Windows 11 22H2, Command Prompt, PowerShell, and other console programs normally open inside Windows Terminal. This changed the console host, not the availability of Windows Script Host.

Rank #4
SIMMAX 32GB Memory Stick USB 2.0 Flash Drives Swivel Thumb Drive Pen Drive (32GB Purple)
  • GOOD VALUE PACKAGE - 1 Pack 32GB Memory Stick USB 2.0 Flash Drives with great cost performance and high quality.
  • BIG CAPACITY - The available capacity: 29.10GB-29.8GB, You can save the data of movies, music, photos, designs, programs, manuals, handouts in a high speed.Good performance in digital data storing, transferring and sharing with families, friends, workmates, clients and machines.
  • EASY TO USE & PLUG AND WORK - Support windows 7 / 8 / 10 / Vista / XP / 2000 / ME / NT Linux and Mac OS, Compatible with USB2.0 and below.
  • TWISTTURN DESIGN & EASY CARRY - The metal clip rotates 360° round the ABS plastic body which with rubber oil skin feeling finish. The capless design can avoid lossing of cap, and providing efficient protection to the USB port.
  • WARRANTY & SUPPORT - SIMMAX logo is laser printed on the USB connector surface, our products are of good quality and we promise that any problem about the product within one year since you buy.

Changing back to the legacy console is useful when a script or application mixes graphical output with text-mode console behavior and fails only inside Windows Terminal. It is not a general repair for a JScript engine error.

Microsoft documents these ways to switch hosts:

  • Settings: Open Start > Settings > System > Advanced. Under Terminal, select Windows Console Host.
  • Windows Terminal: Open Windows Terminal, go to Startup > Default terminal application, and select Windows Console Host.
  • Existing console window: Right-click its title bar, select Properties, and choose Windows Console Host.

For administrators managing the setting directly, Windows stores startup delegation values under HKCU\Console\%%Startup. The values are DelegationConsole and DelegationTerminal, both REG_SZ values. The Windows Console Host GUID for both is {B23D10C0-E52E-411E-9D5B-C09FDF709C7D}. Do not edit these values unless the user-interface setting does not meet your deployment needs.

8. Check common script and launch problems

Symptom Likely area to check
The error names a line and character Syntax or runtime error in the script
The script cannot find a file Relative paths, current directory, or missing dependency
It works only from an administrator console File-system, network, registry, or application permissions
It works with cscript but not by double-clicking Graphical host, file association, or console/GUI assumptions
It fails only in Outlook Custom-form security, trusted message class, or folder script settings
Several linked .js files lose functions between runs JScript execution-context persistence on 24H2/25H2
It fails only in a terminal window Windows Terminal and legacy console-host compatibility

When testing, use the full script path, quote paths containing spaces, and test with the same host used by the production shortcut or application. A script launched by a scheduled task, service, or third-party program may run under a different account and working directory from the same script launched interactively.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

9. Remove a JScript persistence setting after testing

If enabling persistence does not fix the script, or the setting is no longer needed, remove the process-specific value or wildcard value. From an elevated Command Prompt, remove the example wscript.exe value with: reg delete “HKLM\Software\Policies\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ENABLE_PERSISTENCE” /v wscript.exe /f

Replace wscript.exe with the value you created. To remove the all-process setting, run: reg delete “HKLM\Software\Policies\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ENABLE_PERSISTENCE” /v “*” /f

Do not delete the entire key if another application or process-specific value still depends on it.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

FAQ

Does Windows 11 24H2 remove Windows Script Host?

No. Windows Script Host remains available, and Microsoft says VBScript remains enabled by default as an optional feature in Windows 11 24H2. VBScript is being deprecated in phases, but that is different from Windows Script Host being removed in 24H2.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
IMEASON Swivel Design 16GB USB Flash Drive with Keychain, USB 2.0 Portable Thumb Drive Memory Stick, FAT32 Format Flashdrive for Data Storage, Photos, Music, Files (Black, 16 GB)
  • 【16GB Flash Drive】USB flash drives with 16GB capacity, meet your needs of daily use on work, school, home and travelling for photos, music, videos, files storage and transfer. IMEASON thumb drives can be used to store different files, easy to data backup.
  • 【Metal Swivel Cap Design】USB thumb drive is metal swivel cover provides extra protection for the usb thumbdrive connector, no usb drive cap to lose; keychain design makes it easier to carry without worrying lose it.
  • 【Wide Compatibility】USB drive supports Windows 7/8/10/11 / Vista / XP / Unix / 2000 / ME / NT Linux and Mac OS, also Supports USB 2.0 and 1.1 ports. USB Stick support TV, desktop, notebook computer, car, audio and other device. The USB Memory Stick is your great data storage and transfer companion with traveling and working.
  • 【Easy to use】usb memory stick is plug and play without any software installation. Just simply plug the Flashdrive into the port of your USB-compatible devices such as computer, laptop to start data storage or transmission.
  • 【What You Get】16 GB USB Flash Drive Thumb Drive, The default format of the usb storage flash drive is FAT32.

Why did a JavaScript file stop working after upgrading to Windows 11 24H2?

Windows 11 24H2 and 25H2 use jscript9legacy.dll for relevant JScript execution. Its default behavior does not preserve execution context between scripts in the same way as the older engine. Install updates released on or after February 24, 2026, then enable FEATURE_ENABLE_PERSISTENCE for the actual hosting process if the script requires it.

Should I set the JScript registry value to an asterisk?

Only if persistence must apply to every process. A value named for a process, such as wscript.exe or cscript.exe, limits the setting to that host. The * value enables it for all processes and should be used cautiously.

Why does my Outlook custom form still show a script error after enabling VBScript?

Classic Outlook also requires custom-form scripts to be enabled with DisableCustomFormItemScript set to 0, the form message class added under TrustedFormScriptList, and—when applicable—shared-folder or Public-folder scripting enabled in Trust Center.

Will switching from Windows Terminal to Windows Console Host fix every WSH error?

No. The Windows 11 22H2 change affects where console applications run. Switching hosts can help with console-compatibility problems, but it does not repair a script syntax error, a missing dependency, Outlook security settings, or the JScript execution-context issue.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should I use wscript.exe or cscript.exe to test a script?

Use cscript.exe when you need diagnostic text in Command Prompt. Use wscript.exe to reproduce a graphical Windows Script Host launch. If the hosts behave differently, the host environment or the script’s assumptions about console versus graphical output may be relevant.

The Bottom Line

Identify the script type and exact error before changing Windows settings. For JScript failures on Windows 11 24H2 or 25H2, install the current update and enable persistent execution context for the required process. For VBScript, verify the optional feature. For Classic Outlook forms, configure Outlook’s separate security and trusted-form settings. Change the console host only when the failure is specifically tied to Windows Terminal or console compatibility.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.