Windows Script Host Error: 6 Ways to Fix It for Good
Misconfiguration of the Registry may prompt this error
5 min. read
Updated on
Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more
Key notes
- Windows Script Host errors can occur in different varieties, accompanied by varying messages.
- The problem may be due to corrupt system files, issues with the Visual Basic Scripting files, and Windows Registry errors.
- Try running SFC & DISM scans, tweaking the VBS file values in the Registry Editor, and scanning the system for viruses and malware.
Windows Script Host error is one of the recent errors users have been complaining about when booting. The error occurs when the Windows Script Host fails to read a particular script file or encounters any other issue.
Likewise, users report having issues with random Command Prompt opening and closing on their PCs.
What causes Windows Script Host errors?
Windows Script Host error occurs in varieties, making it different in some computers. It can appear as Windows Script Host the system cannot find the file specified, and Windows Script Host permission denied. Some of the causes are:
- Virus and malware attacks – The activities of the Windows Script Host tool may be affected by viruses and malware attacks on your computer. They can infect the crucial system files responsible for the tasks you’re trying to perform with malicious code, resulting in errors.
- Issues with the VBS script file – The VBS script file stores VBScript or Visual Basic Scripting codes in Windows PCs that the Windows Script Host tool interprets and runs. So, any damage or interference with the VBS script file can impede the process, preventing Windows Script Host from functioning correctly.
- Windows Registry errors – The error may pop up when the concerned file isn’t accessible in the Registry directory. Also, installing new programs by overwriting the old programs can cause problems with the files in the registry, impeding the hosting tool from running.
- Corrupt system files – When essential system files are corrupted, it affects how several components of the system work, including the Windows Script Host tool.
These causes are likely to vary depending on the Windows Script Host error message you get. Nevertheless, follow the basic steps we’ll discuss as we go further to fix them.
How can I fix Windows Script Host errors?
Before proceeding with any advanced troubleshooting steps, try the following:
- Turn off background apps running on your PC.
- Unplug external USB devices you’re not using.
- Restart Windows in Safe Mode and check if the Windows Script Host error persists.
If the error persists, try the solutions below:
1. Run the SFC and DISM to repair damaged system files
- Left-click the Start button, type Command Prompt, then click Run as administrator.
- Click Yes on the User Account Control (UAC) prompt.
- Type the following and press Enter:
sfc /scannow
- Type the following commands and press Enter after each:
DISM /Online /Cleanup-Image /RestoreHealth
- Restart your PC and check if the error still appears.
Running SFC and DISM scan on your PC can diagnose and repair corrupted Windows system files causing the Windows Script Host 80070002 error.
Read how to fix the run as administrator option if it’s not working on Windows 11.
2. Change the Default Value of the VBS file
- Press Windows + R key to open the Run dialog box, type Regedit, and press OK to open the Registry Editor.
- Navigate to:
Computer\HKEY_CLASSES_ROOT\.vbs
- Double-click the Default key on the right-hand pane to open it. Change the Value data to VBSfile, then press OK to save these settings.
- Exit the Registry Editor and restart your PC to check if the error appears.
Tweaking the value for the VBS file in the Registry Editor will fix configurations causing the Windows Script Host error.
3. Run Windows Defender scan to remove viruses and malware
- Left-click the Start button, type Windows Security, then click Enter to open it.
- Click on Virus & Threat Protection and select the Scan option link.
- Then select Full scan to initiate an extensive scan and click the Scan now button and wait while the scan completes.
Running Windows Defender scan will detect and remove any malware and viruses affecting your system performance. Read how to fix the Windows virus and threat protection not working on Windows 11.
4. Enable Windows Script Host via the Registry Editor
- Press Windows + R key to open the Run dialog box, type Regedit, and press OK to launch the Registry Editor.
- Navigate to the following path:
HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings
- Double-click the Enabled key on the right pane to open it. Set the Value data to 1.
- If the Enabled key is missing, create it by right-clicking on an empty space on the right side of the screen, select New, then DWORD (32-bit) Value.
- Name the new value as Enabled and then click OK.
- Double-click on the value and set its Value data to 1.
Since the error can occur if the Windows Script Host tool is disabled on your PC, enabling it will fix the issue.
5. Remove Registry Values after Userinit.exe
- Press Windows + R key to open the Run dialog box, type Regedit, and press OK to launch the Registry Editor.
- Copy and paste the following in the search bar to go to the directory:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
- On the right pane, scroll down to Userinit and delete any keys lined below it.
Deleting the following keys that appear after Userinit will resolve any interference they cause. Read about how to fix a corrupt Registry Editor on Windows 11 if you run into a problem.
6. Run System Restore
- Press Windows + R key to open the Run dialog box, type control, then press Enter to open the Control Panel.
- Type recovery in the Control Panel search bar and select Recovery.
- Then click Open System Restore.
- Click Next in the Restore system files and settings window.
- Choose the restore point you want to restore from, then click Scan for affected programs.
Running a System Restore will restore the system to an earlier point, removing recent activities that may be associated with the error.
Do not hesitate to read our guide on how to fix Restore Point if it’s not working on your PC. In addition, we have an extensive guide on fixing the Run.vbs error on Windows 11.
If you have further questions or suggestions, kindly drop them in the comments section.
User forum
0 messages