Windows Script Host Error: Fix It Step by Step
In this article
A Windows Script Host error usually means a script file (.vbs or .js) tried to run and failed because the file is missing, blocked, or the Windows Script Host settings are disabled. The quickest fix is to check the exact error message, then either re-enable the script host in the registry or remove the startup entry that is calling a broken script. Below is a safe, step-by-step way to identify and resolve the problem without breaking other parts of Windows.
What You'll Need
- A Windows PC running Windows 10 or Windows 11 (steps are for desktop Windows; older versions like Windows 7 have similar menus but labels may differ).
- Administrator rights on the account you are using.
- The exact error text — take a photo or write it down before you start changing anything.
- Optional: a restore point created before editing the registry (recommended).
Step-by-Step
- Read the error message carefully. A typical Windows Script Host error includes a line number, a character position, and a short description such as “Object required” or “The system cannot find the file specified.” Write down the file path shown in the error — it tells you which script is failing. If the error appears every time you log in, the script is almost certainly being launched from a startup folder or a registry Run key.
- Restart your PC and see if the error returns. A one-off error may have been caused by a temporary file lock. If the error comes back at the same point (for example, right after signing in), continue to the next step.
- Check whether the script file still exists. Open File Explorer and paste the path from the error into the address bar. If the file is missing, the program that created it may have been uninstalled or moved. In that case, the fix is to remove the startup entry that calls it (see step 5) rather than recreating the file.
- Make sure Windows Script Host is enabled. Open Registry Editor (press Windows key + R, type regedit, press Enter). Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Script Host\Settings. If you see a value named Enabled, double-click it and set it to 1. If the Settings key does not exist, Windows Script Host is enabled by default and you can skip this step. Close Registry Editor when done. (Menu labels in Registry Editor can differ slightly by Windows version.)
- Remove the broken startup entry. Press Ctrl + Shift + Esc to open Task Manager, go to the Startup tab, and look for an entry that matches the script name or the program that owns it. Right-click it and choose Disable. Also check these two folders for shortcuts to the script: C:\Users\<your name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup and C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup. Move any suspicious shortcut to the Recycle Bin. If the entry is in the registry Run key instead, open Registry Editor and check HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run and the same path under HKEY_LOCAL_MACHINE. Export the key first (right-click > Export) so you can restore it, then delete only the value that points to the failing script.
- Run a full malware scan. Some malware uses script files to launch at startup, and a Windows Script Host error can be a symptom of an infection or of malware that has been partially removed. Use Windows Security (Start > Settings > Privacy & security > Windows Security > Virus & threat protection) and run a full scan. Do not download script “fixers” from unofficial sites.
- Re-register the script components if scripts fail everywhere. If every .vbs or .js file gives an error, the script engine may be damaged. Open Command Prompt as administrator and run regsvr32 vbscript.dll and then regsvr32 jscript.dll. Each should confirm success. If either fails, run sfc /scannow from the same window to repair system files, then restart.
- Restore normal script behavior only if you disabled it deliberately. If you previously turned off Windows Script Host for security, the error may simply be a script trying to run while the feature is blocked. Decide whether you actually need that script. If not, leave the block in place and remove the startup entry instead. If you do need it, set the Enabled value back to 1 as in step 4.
Common Mistakes
- Deleting the whole Run registry key. Only remove the single value that points to the failing script. Deleting the key can stop legitimate programs from starting.
- Re-enabling Windows Script Host without checking the source. If the script came from an email attachment or a download you do not recognize, do not enable anything — remove the file and scan the PC first.
- Confusing the error with a browser problem. Windows Script Host errors come from Windows itself, not from a web page. Changing browser settings will not fix them.
- Ignoring the file path. The path in the error message is the single most useful clue. Skipping it usually leads to guessing and unnecessary changes.
- Using “script repair” tools from search ads. These are frequently unwanted software. Stick to built-in Windows tools.
Tips
- Create a restore point before editing the registry: search “Create a restore point” in the Start menu, open System Properties, and click Create.
- If the error names a program you recognize, check that program's settings for an option to disable its startup helper before editing the registry.
- Keep Windows updated through Settings > Windows Update; script engine fixes arrive through normal updates.
- If you use a third-party antivirus, check its quarantine list — it may have removed part of a script and left the startup entry behind.
- Write down every change you make so you can undo it if a new problem appears.
Troubleshooting
The error appears before you can sign in. Restart in Safe Mode (hold Shift while clicking Restart from the sign-in screen, then choose Troubleshoot > Advanced options > Startup Settings). In Safe Mode, disable the startup entry as in step 5, then restart normally.
You cannot open Registry Editor. This can happen if policy settings block it. Try running regedit as administrator from the Start menu search. If it is still blocked, use Task Manager's Startup tab and the Startup folders first, since those cover most cases.
Re-registering the script DLLs fails. Run sfc /scannow and then DISM /Online /Cleanup-Image /RestoreHealth in an administrator Command Prompt. Restart and try again. If the DLLs are still broken, a repair install of Windows using the official media creation tool is the next safe step — back up your files first.
The error returns after you remove the startup entry. Something is recreating it. Run a full malware scan, check Task Scheduler for a task that launches the script, and review installed programs for anything unfamiliar. Do not re-enable Windows Script Host until you know what is calling it.
You need the script to run but it keeps failing. Open the script in Notepad and check the line number from the error. A common cause is a hard-coded path that no longer exists. If you did not write the script, contact the software vendor rather than editing it blindly.
Frequently Asked Questions
Is a Windows Script Host error dangerous?
Not by itself — it is an error message, not a virus. However, because malware sometimes uses scripts, treat repeated errors from unknown files as a reason to run a full scan.
Can I just click OK and ignore it?
Yes, if it appears once. If it appears every time you sign in, it will keep coming back until you disable or remove the startup entry that triggers it.
Will disabling Windows Script Host break other programs?
Most modern programs do not rely on it, but some installers and legacy business tools do. Disable it only if you do not need those, and note that you can re-enable it the same way.
Why does the error mention a file I never created?
The file was likely placed by an installer, an update, or malware. The path in the message shows where it lives; check that folder and the startup locations listed above.
Does this affect Windows 11 the same way?
Yes. The Registry Editor paths and Startup folder locations are the same in Windows 10 and Windows 11, though some menu labels differ slightly.
Can I fix it without editing the registry?
Often yes. Disabling the entry in Task Manager's Startup tab or removing a shortcut from the Startup folder resolves most recurring errors. Use the registry only when the entry is not listed there.