If you’ve had enough of the Windows Script Host error popping up whenever you boot your system or try to start an application, this page is where you should be. 

You can temporarily remove the error message by ending the corresponding process in the Task Manager, but we have permanent solutions for you. 

This article will show you how to eliminate Windows Script Host pop-ups.

Let’s begin. 

What Is a Windows Script Host Error?

First, what is a Windows script host? It’s a system tool handling scripts run by system administrators. 

The error occurs when the Windows Script Host tool fails to read a particular script file or encounters any other issue. 

The problem might be due to a malicious program, faulty system file, bad script file, or defective hard disk.

How to Fix a Windows Script Host Error in Windows 10

The following guides will show you how to fix Windows script problems on startup or when you launch apps.

Fix 1: Run the System File Checker

Microsoft Windows-based script host errors can result from faulty system files. Malicious programs might have compromised these files or might be victims of application conflicts. In some cases, you might have tampered with them.

The System File Checker (SFC) is a built-in command-line program that Microsoft provides for replacing bad or missing system files.

In older Windows versions, you must fire up the Command Prompt with admin privileges and run the SFC line.

However, in Windows 10, you must run DISM before running SFC. 

DISM is another built-in command-line tool. Its job is to provide the files that will be used by the SFC tool for the repair process.

Here’s a simple guide on how to run the SFC command properly:

  • Type Command Prompt in the search bar
  • Right-click on it and select Run as administrator.
  • Select Yes once the User Account Control dialog requests permission.
  • When the Command Prompt window opens, type DISM.exe /Online /Cleanup-image /Restorehealth and press Enter.
Windows Script Host Error
  • Allow the DISM tool to use the Windows Update utility to provide the repair files before running the SFC tool. 
Run Command Prompt as Administrator

If Windows Update fails to provide the repair files, you’ll have to use the DISM tool to fetch them from a different source, such as a bootable USB or Windows 10 DVD. 

You’ll also have to enter the following command instead: DISM.exe /Online /Cleanup-Image /RestoreHealth /Source:C:\RepairSource\Windows /LimitAccess

Note
The C:\RepairSource\Windows part of the command should be replaced with the Windows directory on the USB drive.
 

  • Once the DISM tool has completed its job, go to a new line and type sfc /scannowinto the Command Prompt window, then press Enter.
Command Prompt Restore Operation
  • The utility will scan your PC for bad and missing system files and replace them automatically.
  • Wait until the verification process is 100% complete before you close the Command Prompt.
how to fix windows script host errors on startup

You’ll see a completion message that tells you the process results.

The message that reads Windows Resource Protection did not find any integrity violations means you don’t have broken system files. 

The message, Windows Resource Protection found corrupt files and successfully repaired them. Details are included in the CBS.Log C:\Windows\Logs\CBS\CBS.log means that bad system files were found and replaced.

Running the SFC command in Safe Mode

However, if the Command Prompt tells you that “Windows Resource Protection could not perform the requested operation,” you must run the SFC command in Safe Mode. Follow this guide:

  • Switch on your computer and press and hold your power button to turn it off once your computer manufacturer’s logo flashes on your screen. Reboot your PC in that manner twice again until you see the Please wait message.
  • Click the Advanced Options button after seeing the Automatic Repair screen.
  • The Choose an Option screen will now appear.
  • Click on Troubleshoot.
  • On the Troubleshoot page, click on the Advanced Options tile.
  • Click Startup Settings once the Advanced Options screen appears.
  • Once you see the Startup Settings screen, click the Restart button.
  • Your system will now reboot to the Startup Options page.
  • Tap the number next to Safe Mode with networking (Since you need an internet connection to run the DISM tool to provide the repair files).
  • After your system starts in Safe Mode, go to the C:\Windows\WinSxS\Temp folder to confirm that the PendingDeletes and PendingRenames directories are present.
  • Now, open the Command Prompt as an administrator, then run the DISM and SFC tools.

Related: Windows Command Prompt: Most Useful Commands


Fix 2: Scan your hard disk for problematic sectors using the CHKDSK utility

Every file your computer works with, from system to application files, is stored on your hard disk. Errors will naturally occur when programs and services can’t read files.

This phenomenon doesn’t exclude the Windows Script Host. Usually, the Windows script error suggests that some files can’t be reached.

The CHKDSK utility is designed to find bad sectors on the hard drive and prevent your system from ever using those sectors. 

It can also attempt to retrieve files stored in those bad sectors, but this is not guaranteed to always work. You might have to sacrifice some files.

In this case, the tool might help you recover the file the Windows Script Host is looking for.

If it doesn’t, you can rest assured that the problem will not occur again once you’ve obtained the file elsewhere.

Two main ways to run the CHKDSK utility are via the File Explorer and in an elevated Command Prompt window. 

Here’s how to use both methods.

Checking your disk via File Explorer

  • Double-click on any folder on your desktop to open a File Explorer window. The Windows + E keyboard shortcut is another way to launch Windows File Explorer.
  • After File Explorer opens, navigate to the left pane and click This PC.
Checking Your Disk via File Explorer
  • Switch to the right pane and right-click on the drive where Windows is installed.
  • Click on Properties in the context menu.
This PC Properties on File Explorer
  • When you see the Properties dialog window, go to the Tools tab and click on Check under Error Checking.
  • Click on Scan Drive after the You don’t need to scan this drive dialog message appears.
  • The CHKDSK tool will now scan your hard disk for errors.
  • After the scan, a dialog will appear and show you the results. After, check to see if the Windows script file error has been fixed. 

Checking your disk via Command Prompt

If the File Explorer method doesn’t resolve the problem, open the Command Prompt window to run a more in-depth and advanced check.

The guide below will show you how:

  • Go to the search box in the Start menu and type Command Prompt.
  • Once Command Prompt appears in the search results, right-click it and select Run as administrator.
  • Select Yes once the User Account Control dialog window requests permission.
  • After the Command Prompt window opens, type chkdsk C: /f /r /x into the new line and hit Enter.

Note
The “C” in the command line should be replaced with the drive letter of your Windows volume.
 

If you see the message Chkdsk cannot run because the volume is in use by another process. Would you like to schedule this volume to be checked the next time the system restarts? (Y/N), it means other applications currently use the volume you’re trying to scan. 

Hit the Y keyboard button if the Command Prompt asks you to schedule the scan for your next reboot.

Once you tap Y, restart your computer to complete the check, then check for the error.


Related: How to Check For and Fix Disk Errors with CHKDSK Command 


Fix 3: Run a full malware scan

One of the main causes of the Windows Script Host error is malware infection.

Hackers have the ugly habit of designing malware programs to clone or completely replace script files to wreak havoc without detection.

With the technical know-how, these hidden malicious scripts can be removed. However, you can use an anti-malware program to search for and delete malware infections. 

PRO TIP
You can check out Auslogics Anti-Malware software to thoroughly scan folders and restricted areas where the malware program might be hiding.

Whether you’re using a third-party antivirus or Windows Security, ensure your system is up to date.

This way, you’re sure the program is fortified with the latest virus definitions. If you use Windows Security, follow these steps:

  • Go to your taskbar’s notification area and click the arrow to expand the system tray.
  • After the hidden icons appear, open Windows Security.
Windows Security
  • Next, click on Virus & Threat Protection.
  • Once the Virus & Threat Protection window appears, click on Scan Options.
Virus-and-Threat-Protection
  • When you reach the Scan Options page, select the Full Scan option, then click the Scan Now button.
Virus and Threat Protection
  • Note that the full scan can take up to several hours. So, allow your system to run the operation and return later.
  • After the scan is complete, prompt the antivirus to remove the malware programs it found.

Related: How to Remove Virus and Other Malware from Windows 


Fix 4: Run the Microsoft safety scanner

The Microsoft Safety Scanner is an advanced Microsoft-developed virus-removal tool. It checks for security risks and removes them.

Once it finds malicious programs, it will try undoing the changes they’ve made to your computer.

Some users reported positive results after running the tool.

Follow these steps to use the utility:

  • Make sure you download the program’s latest version from Microsoft’s website.
  • After you download the EXE file, run it.
  • Select Yes in the User Account Control dialog panel.
  • Once the program opens, choose the type of scan you want it to run. Go for the Full Scan option to scan the entire system.
  • The scan can take hours to complete. Rather than staying on your computer while it runs, you can run it when you’re less busy.
  • Click on Next.
  • After the scan completes, allow the tool to take necessary actions if it finds any malicious program. Then, check if the Windows script host issue has been resolved. 

Fix 5: Perform a clean boot

A startup application may be responsible since the Windows Script Host error usually occurs during or immediately after startup.

Startup applications are programmed to launch whenever Windows starts. They’re essentially the first set of programs the operating system wakes up after the boot.

One or more of these apps and services could interfere with the Windows Script Host and trigger the startup error you see. By performing a clean boot, you can find the responsible program.

The clean boot technique prevents non-Windows-related startup applications from launching after you reboot your system.

Once you’ve done that, check if the Windows Script Host error occurs again.

Here’s a guide on how to perform a clean boot and figure out which startup program is causing the error:

  • Right-click the start button to open the Power User menu, then click Run. Punch the Windows key + R keyboard buttons together to open Run.
  • Once you see the Run dialog box, go to the text field, type msconfig and hit the Enter button on your keyboard.
Perform a Clean Boot
  • Once the System Configuration dialog window appears, switch to the Services tab.
  • Navigate toward the Services tab’s bottom-left corner and check the Hide all Microsoft services checkbox. Doing this will prevent Windows from blocking Microsoft-related services.
Windows System Configuration
  • Now, click on the Disable All button.
Windows System Configuration disable all
  • Next, head to the Startup tab and click Open Task Manager.
  • Once you get to the Task Manager’s Startup tab, you can disable every program you see by clicking on each one and clicking on the Disable button.
Windows System Configuration disable all
  • Return to the System Configuration dialog window and click OK.
  • Restart your system and check if the script error has been resolved. 

If the error does not pop up once your system comes up, you just confirmed the involvement of a startup application or service. 

To find the responsible entity, you have to enable the startup items one after the other and restart your system after enabling each.

At some point, one item will trigger the error again.

Easier Way to Isolate the Responsible Program

  • Open the “System Configuration” dialog window and switch to the “Services” tab.
  • Go to the Services tab, uncheck half of the startup services, and click “Enable All.”
  • Restart your system and see if the error is resolved. If the error doesn’t appear, none of the services you have enabled is the culprit. You’ll have to enable the other half and restart your system to see if the error happens again.
  • If the error shows up after enabling one group of the startup services, you only have to focus on checking them one after the other instead of checking everything.

Also Read: Quick Tips: How to Disable Startup Programs in Windows 10


Fix 6: Return the default value of .vbs to VBSfile in the registry editor

VBS is a type of scripting file that the WSH (Windows Script Host) can run.

Many WSH errors point to faulty or misconfigured VBS files, and making a few changes to the system registry may fix the problem. We’ll show you the steps to take.

Before you begin, note that the system registry is one of your operating system’s most advanced and sensitive areas. A single mistake can render your computer unusable. 

So, tread with caution. If you don’t know your way around the registry or aren’t comfortable using it, get someone with expertise to apply the solution.

However, if you want to handle things yourself, we recommend backing up the entire registry to be safe. If you can do that yourself, head straight to the solution to find out how to adjust the default .vbs value.

However, keep reading if you don’t know how to back up the registry.

How to back up the system registry

  • Press the Windows logo and R buttons to launch the Run dialog window.
  • After Run opens, go to the text field, type Regedit and click the OK button.
  • Click the Yes button once the User Account Control dialog window pops up and request permission.
Windows 10 Registry Editor
  • When the Registry Editor opens, go to the window’s top-left corner and click on File.
  • Select Export from the context menu.
Registry Editor Export
  • Once the Export Registry File dialog window opens, select All under Export Range.
  • Navigate to the folder where you’d like to save the backup, enter a name for the file, and then click on the Save button.

That’s it! To restore the registry, open the Registry Editor and click on File > Import. Then, go to the folder where you saved the backup file and double-click it.

Here’s how to change the default value of .vbs:

  • Press the Windows logo + R buttons to launch the Run dialog window.
  • After Run opens, go to the text field, type Regedit and click the OK button.
  • Click the Yes button once the User Account Control dialog window pops up and request permission.
  • When the Registry Editor opens, go to the left pane and expand HKEY_CLASSES_ROOT.
How to Change the Default Value of .vbs-
  • Under HKEY_CLASSES_ROOT, click on .vbs.
Default Value of .vbs-
  • Navigate to the right pane and double-click on the Default string.
  • Once the Edit String dialog opens, go to the Value Data text box and change the value to VBSfile.
  • Click on OK.

How to delete the VMApplet and WinStationDisabled strings in the registry editor. 

  • Open the Registry Editor and head to the left pane.
  • Navigate to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon.
  • Single-click on WinLogon, then switch to the right pane.
  • Scroll down and delete the VMApplet and WinStationDisabled entries.
  • Next, double-click Usernit.
  • Replace its value data with C:\Windows\system32\userinit.exe and click on OK.
Download Auslogics Anti-Malware
Detects malware, spyware and viruses, then safely removes them from your PC to help keep it as secure as possible. The program is made to complement your main antivirus.

Also Read: What is the Windows Registry And Why Do You Need a Registry Cleaner?


Conclusion

It can be very annoying to deal with the Windows Script Host error, especially if it continues occurring when you launch programs or start your computer. Luckily, this guide covers the solutions.

We’ve examined the root causes of this mistake and provided step-by-step instructions on repairing it in this guide.

We’ve discussed fixing your system files with tools like System File Checker (SFC), detecting and eliminating nasty malware, and even changing some computer settings to fix the error.

Remember that even though we’ve tried to keep things easy, you should exercise caution when changing your computer.

Pay great attention to the instructions, and ask a computer expert for clarification if you’re unsure of anything.

FAQ

There are measures you can take to fix the Windows Startup Script error in Windows 7, despite how frustrating it can be. Scripts running on your system that are malicious or incompatible frequently produce this message.

You can run a comprehensive malware scan to ensure that no dangerous scripts are to blame for the problem.

Another way is to turn off or delete any shady or pointless startup programs that could be the source of the issue.

Windows Script Host helps you automate processes and run scripts on Windows operating systems.

It offers a platform on which scripts written in other scripting languages, such as VBScript and JScript, can be executed.

These scripts can manage files and folders, connect with system components, automate processes, and carry out various other functions on your computer.

Windows Script Host Settings are the configuration choices that manage how Windows Script Host runs scripts.

The Windows Registry provides access to and editing capabilities for these settings. Aspects like timeout settings, script execution rights, and error-handling behavior are all under the user’s control.

An issue that arises while executing a script is a script error, typically in web browsers or scripting environments. These problems happen when a bug in the script’s code prevents it from running correctly.

Script errors are frequently encountered when visiting websites with interactive elements that employ JavaScript.

They may appear as pop-up error warnings or be recorded in the browser developer console.