If you’ve had enough of Windows Script Host errors 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. In this article, we’ll show you how to get rid of Windows Script Host pop-ups.

What Is a Windows Script Host Error?

This kind of error shows up when the Windows Script Host tool, which is in charge of handling scripts run by system administrators, 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 Windows Script Host Errors in Windows 10

The guides that follow will show you how to fix Windows Script Host errors on startup or when you launch apps.

Run the System File Checker

Windows Script Host errors can be the result of faulty system files. These files might have been compromised by malicious programs or might be victims of application conflicts. In some cases, you might have tampered with them.

Thankfully, you can easily replace bad or missing system files using the System File Checker (SFC). SFC is a built-in command-line program. Microsoft provided the tool for such purposes.

In older Windows versions, all you have to do is fire up the Command Prompt with admin privileges and run the SFC line. However, in Windows 10, you have to run DISM before running SFC. DISM, which is short for Deployment Image Servicing and Management, 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:

  1. Open the Command Prompt with admin privileges. Here is how to do that:
  • Go to the search box in the Start menu and type “command.”
  • Once Command Prompt shows up in the search results, right-click it and select “Run as administrator.”
  • Select Yes once the User Account Control dialog requests permission.
  1. After the elevated Command Prompt window opens, type the line below and press Enter:

DISM.exe /Online /Cleanup-image /Restorehealth

Allow the DISM tool to use the Windows Update utility to provide the repair files before running the SFC tool. If Windows Update fails to provide the repair files, you’ll have to use the DISM tool to fetch the repair files 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

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

  1. Once the DISM tool has completed its job, go to a new line and type “sfc /scannow” (no quotes) into the elevated Command Prompt window, then press the Enter key.
  2. The utility will now scan your PC for bad and missing system files and replace them automatically.
  3. Wait until the verification process is 100% complete before you close the Command Prompt.

You’ll see a completion message that tells you the results of the process. The message that reads “Windows Resource Protection did not find any integrity violations” means that you do not have broken system files. The message that says “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.

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

  1. Go to the Start menu, click on the power icon, and then select Shut Down.
  2. Once your system goes off, tap the power button to switch it on, then 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.
  3. Click on the Advanced Options button after you see the Automatic Repair screen.
  4. The Choose an Option screen will now appear.
  5. Click on Troubleshoot.
  6. On the Troubleshoot page, click on the Advanced Options tile.
  7. Click on Startup Settings once the Advanced Options screen appears.
  8. Once you see the Startup Settings screen, click the Restart button.
  9. Your system will now reboot to the Startup Options page.
  10. 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).
  11. 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.
  12. Now, open the Command Prompt as an administrator, then run the DISM and SFC tools.

Scan your hard disk for problematic sectors using the CHKDSK utility

Every file that your computer works with, from system files 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. Most of the Windows Script Host errors suggest 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 on those bad sectors, but this is not guaranteed to work all the time. You might have to sacrifice some files.

In this case, the tool might help you recover the file that the Windows Script Host is looking for. If it doesn’t, then you can rest assured that the problem won’t occur again once you’ve managed to get the file via other means.

There are two main ways to run the CHKDSK utility: via the File Explorer and in an elevated Command Prompt window. You’ll find out how to use both methods.

Checking your disk via File Explorer

  1. Double-click on any folder on your desktop to summon a File Explorer window. The Windows + E keyboard shortcut is another way to launch File Explorer.
  2. After File Explorer opens, navigate to the left pane and click This PC.
  3. Switch to the right pane and right-click on the drive where Windows is installed.
  4. Click on Properties in the context menu.
  5. When you see the Properties dialog window, head to the Tools tab, then click on Check under Error Checking.
  6. Click on Scan Drive after the “You don’t need to scan this drive” dialog message appears.
  7. The CHKDSK tool will now scan your hard disk for errors.
  8. After the scan, a dialog will appear and show you the results.

Checking your disk via Command Prompt

If the File Explorer method does not resolve the problem, open an elevated Command Prompt window to run a more in-depth and advanced check.

The guide below will show you how:

  1. Open the Command Prompt with admin privileges. To do that, follow the instructions below:
  • Go to the search box in the Start menu and type “command.”
  • Once Command Prompt shows up in the search results, right-click it and select “Run as administrator.”
  • Select Yes once the User Account Control dialog window requests permission.
  1. After the elevated Command Prompt window opens, type this command into the new line and hit the Enter key:

chkdsk C: /f /r /x

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

Here’s a brief explanation about the additional command switches:

The “/x” switch allows CHKDSK to unmount the volume before the scanning process starts.

The “/r” switch prompts the utility to check for bad sectors and recover any readable information.

The “/f” parameter allows the tool to fix errors detected during the scan.

If you see the following message, other applications are currently using 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:

“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)”

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

Run a full malware scan

One of the main causes of Windows Script Host errors 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 fished out. However, a capable antivirus program has what it takes to find the malware and get rid of it in the quickest possible way.

RECOMMENDED

Protect PC from Threats with Anti-Malware

Check your PC for malware your antivirus may miss and get threats safely removed with Auslogics Anti-Malware

Auslogics Anti-Malware is a product of Auslogics, certified Microsoft® Silver Application Developer
DOWNLOAD NOW

Even if you have an outstanding antivirus program, relying on the regular quick scans and real-time protection feature won’t help. Many security programs have the Full Scan feature, which goes deep into system folders and restricted areas where the malware program might be hiding.

If Windows Security is your main antivirus program, make sure your system is up to date. This way, you’re sure the program is fortified with the latest virus definitions. If you use a third-party antivirus, you also have to ensure you have its latest version.

If you don’t know how to run the Full Scan in your antivirus program, you can head to its developer’s website to determine how to do that. If you use Windows Security, follow these steps:

  1. Go to your taskbar’s notification area and click on the arrow to expand the system tray.
  2. After the hidden icons appear, click on the white shield to open Windows Security.
  3. Next, click on Virus & Threat Protection.
  4. Once the Virus & Threat Protection window appears, click on Scan Options.
  5. When you get to the Scan Options page, select the Full Scan option, then click on the Scan Now button.
  6. Note that the full scan can take up to several hours. So, allow your system to run the operation, then come back later.
  7. After the scan is complete, prompt the antivirus to remove the malware programs that it has found.

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:

  1. Make sure you download the latest version of the program from Microsoft’s website.
  2. After you download the EXE file, run it.
  3. Select Yes in the User Account Control dialog panel.
  4. 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.
  5. The scan can take hours to complete. You can run it when you’re less busy rather than stick to your computer while it runs.
  6. Click on Next.
  7. After the scan completes, allow the tool to take necessary actions if it finds any malicious program.

Perform a Clean Boot

Since most Windows Script Host errors occur during or immediately after startup, a startup application may be responsible.

Startup applications are programmed to launch whenever Windows starts. They’re essentially the first set of programs that the operating system wakes up after the boot process. One or more of these apps and services could get in the way of the Windows Script Host and trigger the startup error you’re seeing.

You can find the responsible program by performing a clean boot. The clean boot technique involves preventing every non-Windows-related startup application from launching after you reboot your system. Once you’ve done that, you can 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:

  1. Right-click on the start button to open the Power User menu, then click on Run. Alternatively, punch the Windows logo and R keyboard buttons together to open Run.
  2. Once you see the Run dialog box, go to the text field, type “msconfig” and hit the Enter button on your keyboard.
  3. Once the System Configuration dialog window appears, switch to the Services tab.
  4. 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.
  5. Now, click on the Disable All button.
  6. Next, head to the Startup tab and click on “Open Task Manager.”
  7. Once you get to the Task Manager’s Startup tab, disable every program you see by clicking each program and clicking on the Disable button.
  8. Head back to the System Configuration dialog window and click on OK.
  9. Restart your system and check for the error.

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.

Here’s a different and easier way to isolate the responsible program:

  1. Open the System Configuration dialog window and switch to the Services tab.
  2. Go to the Services tab, uncheck half of the startup services, and click on Enable All.
  3. Restart your system and see if the error is resolved. If the error doesn’t appear, then 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.
  4. 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.

Return the default value of .vbs to VBSfile in the Registry Editor

VBS is a type of scripting file that the WSH 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 the most advanced and sensitive areas in your operating system. A single mistake can render your computer unusable. So, make sure you 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 for you.

However, if you want to handle things yourself, we recommend that you back 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, if you don’t know how to back up the registry, keep reading.

Backing up the system registry

  1. Press the Windows logo and R buttons to launch the Run dialog window.
  2. After Run opens, go to the text field, type “Regedit,” and click on the OK button.
  3. Click on the Yes button once the User Account Control dialog window pops up and requests permission.
  4. When the Registry Editor opens, go to the top-left corner of the window and click on File.
  5. Select Export from the context menu.
  6. Once the Export Registry File dialog window opens, select All under Export Range.
  7. 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.
  8. That’s it! Whenever you want to restore the registry, open the Registry Editor, click on File >> Import. Go to the folder where you saved the backup file and double-click it.

Here are the steps you should follow to change the default value of .vbs:

  1. Press the Windows logo and R buttons to launch the Run dialog window.
  2. After Run opens, go to the text field, type “Regedit,” and click on the OK button.
  3. Click on the Yes button once the User Account Control dialog window pops up and requests permission.
  4. When the Registry Editor opens, go to the left pane and expand HKEY_CLASSES_ROOT.
  5. Under HKEY_CLASSES_ROOT, click on .vbs.
  6. Navigate to the right pane and double-click on the Default string.
  7. Once the Edit String dialog opens, go to the Value Data text box and change the value to VBSfile.
  8. Click on OK.

You can also delete the VMApplet and WinStationDisabled strings in the Registry Editor. Follow these steps:

  1. Open the Registry Editor and head to the left pane.
  2. Navigate to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon.
  3. Single-click on WinLogon, then switch to the right pane.
  4. Scroll down and delete the VMApplet and WinStationDisabled entries.
  5. Next, double-click Usernit.
  6. Replace its value data with “C:\Windows\system32\userinit.exe” (no quotes) and click on OK.

Repair install your PC

If none of the above methods work, you’re left with the option of repairing your Windows 10 installation. This option will help you replace broken system files and other software dependencies for WSH.

Conclusion

We believe you were able to resolve the problem for good. Please head to the comments section if you have anything to share with our community.