Некоторые пользователи Windows 11, Windows 10 могут столкнуться с сообщениями об ошибках Windows Script Host при входе в систему, запуске каких-либо программ и в других ситуациях. Сами ошибки могут отличаться: «Не удается найти указанный файл», «Не удается найти файл сценария», «Не удается сохранить ярлык» и другие.
В этой инструкции подробно о том, чем могут быть вызваны ошибки Windows Script Host и варианты решения проблемы. Внимание: материал предназначен для рядовых пользователей, столкнувшихся с ошибкой, а не для разработчиков скриптов.
Самопроизвольное появление ошибок Windows Script Host при входе в систему или во время работы
Самый частый случай появления проблемы — ошибка появляется без каких-либо действий со стороны пользователя: обычно при входе в Windows, иногда — во время работы в произвольные моменты времени. Типичные сообщения Windows Script Host об ошибке для этой ситуации:
При этом сам файл сценария (скрипт) — это обычно какой-либо файл с расширением .vbs, имеющий название похожий на что-то системное, имеющее отношение к обновлениям, Windows, иногда — просто run.vbs
Обычно причина ошибки Windows Script Host в данном случае — наличие прописанного автоматического запуска скрипта .vbs в автозагрузке Windows, либо в планировщике заданий.
С большой вероятностью прописан он был каким-то вирусом или иным вредоносным ПО. При этом первые два приведенных в примере сообщения об ошибке обычно говорят о том, что сам вирус уже был удален, однако от него остались «хвосты» в виде попытки запуска файлов из автозагрузки.
Общий порядок действий для этой ситуации:
- Скачайте утилиту Autoruns с сайта Майкрософт , распакуйте у себя на компьютере в удобное расположение и запустите утилиту.
- Используйте поле быстрого поиска для того, чтобы найти записи в автозагрузке, запускающие скрипты .vbs, для этого достаточно ввести соответствующее расширение в поле поиска (фильтра).
- Если такие элементы были найдены, вы можете удалить их, нажав по ним правой кнопкой мыши и выбрав соответствующий пункт контекстного меню.
- Также выполните поиск по wscript и изучите найденные элементы: если они подозрительны, имеет смысл удалить их.
После удаления всех записей для запуска файла в автозагрузке Windows, рекомендую:
- Удалить и сам этот файл: обычно он располагается в одной из папок с временными файлами.
- Выполнить дополнительную проверку компьютера на вирусы и наличие вредоносных программ, например, с помощью KVRT (не требует установки на компьютер и не конфликтует со встроенным антивирусом).
Ошибки Windows Script Host при установке программ и игр
Остатки работы вредоносного ПО на компьютере — не единственный случай, когда вы можете столкнуться с ошибками Windows Script Host: например, некоторые установщики игр и программ могут использовать скрипты .vbs или другие для создания ярлыков или других задач.
Эти скрипты запускаются с помощью Windows Script Host (wscript.exe) и при сбоях выполнения действий, прописанных в них, вы можете получить те или иные сообщения об ошибках.
Возможные решения для типичных ошибок для данного случая:
- Если вы видите сообщение Windows Script Host о невозможности создать ярлык — можно попробовать выполнить запуск установщика от имени администратора.
- При ошибке «На данном компьютере отключен доступ к серверу сценариев Windows» откройте редактор реестра (Win+R — regedit), перейдите к разделу
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings
и проверьте наличие параметра DWORD с именем Enabled. Если он присутствует и его значение равно 0, дважды нажмите по нему и установите 1 в качестве значения. При отсутствии параметрам, создайте его и задайте значение 1.
- Сообщения об ошибках Windows Script Host «Не удается найти указанный файл, код 80070002» или «Не удается найти файл сценария» в процессе установки игр и программ обычно появляется при установке нелицензионного софта, когда какие-то из файлов автоматически удаляются встроенным антивирусом Windows. О возможных решениях в инструкции Что делать, если Windows сама удаляет файлы.
В некоторых случаях ошибки Windows Script Host могут быть вызваны сбоями в системе или повреждением системных файлов, может иметь смысл попробовать:
- Использовать точки восстановления системы
- Выполнить восстановление целостности системных файлов
- Установить последние обновления Windows
Если ваша проблема с Windows Script Host отличается от описанных в инструкции, расскажите о том, что именно происходит, какое сообщение об ошибке вы наблюдаете и при каких обстоятельствах. Возможно, я или кто-то из читателей сможет вам помочь.
С ошибкой сценария хоста Windows можно столкнуться в любое время, независимо от того, какую версию операционной системы вы используете. Неожиданное появление этого сбоя указывает на то, что какой-то модуль работает не так, и необходимо внести соответствующие исправления.
Однако пользователи часто не понимают, какое сообщение содержится в самой ошибке. Путаница происходит потому, что сбой в Windows Script Host не зависит от программного обеспечения, установленного на устройстве. Скорее он представляет собой строку в сценарии, который является частью самой операционной системы.
При этом причины возникновения этой проблемы могут различаться, но чаще всего это указывает на заражение вредоносным ПО. Поэтому в качестве самого первого шага, в попытке исправить ситуацию, следует выполнить полное сканирование системы с помощью надёжного антивирусного программного обеспечения. Помимо этого проблема может быть вызвана повреждёнными системными файлами, ошибками в реестре или чем-то ещё. Поэтому ниже вы найдете несколько решений, для разных ситуаций.
Решение 1. Просканируйте свой компьютер на наличие вредоносных программ
Хотя на рынке существует множество сторонних приложений для защиты системы, Windows включает в себя бесплатный антивирус — Защитник Windows. В настоящее время это программное обеспечение находится на одном уровне со многими известными поставщиками ПО безопасности. Поэтому при отсутствии на компьютере стороннего антивируса, используйте его. Первым делом необходимо выяснить, заключается ли проблема в наличии вредоносных программ на ПК.
Просканируете компьютер:
- Щелкните правой кнопкой мыши Пуск и выберите Параметры.
- Перейдите к обновлению и безопасности.
- Выберите Безопасность Windows слева и нажмите Защита от вирусов и угроз.
- Затем кликните на Параметры сканирования;
- Нажмите флажок Проверка автономного Защитника Windows и Сканировать сейчас.
Это действие перезагрузит компьютер и запустит глубокое сканирование системы.
Решение 2. Запустите сканирование SFC и DISM
Средство проверки системных файлов может диагностировать и восстанавливать проблемные или повреждённые системные данные Windows:
- Введите cmd в поиске Windows.
- Щелкните правой кнопкой мыши командную строку и выберите Запуск от имени администратора.
- В новом окне введите sfc /scannow и нажмите Enter. Выполните сканирование SFC.
- Дождитесь завершения работы программы, и перезагрузите компьютер.
Если сканирование SFC ничего не нашло или не смогло исправить обнаруженные нарушения целостности, вам следует выполнить восстановление образа Windows с помощью DISM. Откройте командную строку от имени администратора ещё раз и запустите следующие команды, нажимая Enter после каждой:
- Dism/Online/Cleanup-Image/CheckHealth;
- Dism/Online/Cleanup-Image/ScanHealth;
- Dism/Online/Cleanup-Image/RestoreHealth.
Решение 3. Восстановите значение VBS по умолчанию через реестр
Неправильное изменение реестра Windows может привести к ошибкам, повреждению системных файлов и ОС. Убедитесь, что вы сделали резервную копию базы данных, прежде чем переходить к следующим шагам.
- Введите regedit в поиске Windows и нажмите Enter.
- Зайдите в реестр. Если отобразится Контроль учётных записей пользователей, нажмите Да.
- В открывшемся окне реестра нажмите на строку Правка, а затем — Найти и введите Vbs — нужно найти одноименную папку.
- Дважды щелкните ключ по умолчанию справа.
- Убедитесь, что для ключа установлено значение VBSFile, и нажмите OK.
- Восстановите значение VBS по умолчанию.
Решение 4. Отключите Windows Script Host через реестр
Windows Script Host был представлен в Windows 98 — он позволяет запускать на компьютере больше языков программирования. К сожалению, если вредоносному ПО удастся проникнуть в устройство, оно может злоупотребить этим и получить доступ к большему количеству внутренних функций. Таким образом, полное отключение Windows Script Host, если он не используется, является хорошей практикой безопасности, которая также остановит появление связанной с ним ошибки.
- Введите regedit в поиске Windows и нажмите Enter.
- После захода в редактор реестра перейдите по следующему пути: HKEY_CURRENT_USER\Software\ Microsoft\Windows Script Host\Settings\.
- Если справа вы не видите ключ Enabled, создайте его.
- Для этого щелкните правой кнопкой мыши в пустое место в правом окне и выберите «Создать»> «Значение DWORD (32 бита)».
- После появления ключа дважды щелкните по нему ЛКМ и установите для него значение 0 Отключить хост Windows Script.
- Теперь перейдите по следующему пути и повторите шаги, описанные выше: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings\.
Примечание. При каждой попытке запуска файла VBS вы будете получать сообщение об ошибке: «Доступ к сценарию хоста Windows отключён на этом компьютере». Вы можете повторно включить его, изменив значение ключа в упомянутых разделах реестра на 1.
Windows Script Host is an administration tool built into every Windows operating system. Its main function is the scripting abilities like batch files. The Windows Script Host error may appear on your Windows 10 computer due to virus invasion, registry errors, or VBS script files. This article on MiniTool mainly discusses how to fix Windows Script Host on Windows 10 and how to recover deleted files if needed.
What does Windows Script Host do?
Windows Script Host, short for WSH, is a Microsoft technology; it is designed for computer administrators to automate and manage some tasks for client computers (or servers). The scripting abilities which can be comparable to batch files are included in Windows Script Host. One of the most obvious characteristics is: it’s language-independent. That means the host can work with different Active Scripting language engines.
All in all, the Windows Script Host provides an environment for Windows users to execute scripts in different languages which will perform tasks via different object models.
Windows Script Host Error Windows 10
Windows Script Host Error
What is Windows Script Host error? It is an error that occurs now and then on PCs running all versions of Windows operating system. The Windows Script Host error is system related (it’s independent of any specific software) and often indicates the virus/malware infection, registry issue, or VBScript file problem.
Many people encounter this problem because the Windows Script Host tool has been damaged in their computers. The following content shares the causes and different situations of Windows Script Host issue.
What Causes Windows Script Host Errors
Three types of reasons are found to be responsible for Windows Script Host errors in Windows 7/8/10/11.
- Virus or Malware: A virus or malware attack is proven to be the major cause of the Windows Script Host error. The virus/malware may attack your system and infect the crucial system files with malicious code. In this case, you must remove/eliminate the virus completely in time; otherwise, it may delete your valuable files/partitions, and even ruin your system.
- VBS script file damage: the VBS script refers to the file that contains VBScript or Visual Basic Scripting codes. If the file goes wrong, it will cause several Windows Script Host errors.
- Registry errors: this type of error usually shows up when you install new programs over the old programs directly. This will result in a slow speed in opening the programs and even a sudden crash in the system. To avoid this, you should uninstall the old ones completely before starting the installation of the new program.
Windows Script Host: Error Messages
The execution of the Windows Script Host failed sometimes and you may find yourself stuck in the following situations.
Situation 1: Windows Script Host Access Is Disabled on This Machine
You may encounter Windows Script Host access is disabled on this machine, Contact your administrator for details.
Obviously, the error appears because you lose access to Windows Script Host on your current machine.
- If you are using another person’s computer, you should ask the administrator for help, as suggested.
- Yet, if you are running your own computer, you may try the methods that will be introduced in the next part to gain access again.
Situation 2: Windows Script Host Can Not Find Script File
Windows Script Host says Can not find script file “C:\Users\Public\Libraries\Checks.vbs” (the file location is not fixed). This “can not find script file” error occurs when the certain script file needed by the system currently has been damaged or lost. In theory, you could recover/repair the needed script file to fix the Windows Script Host cannot find script file issue.
Additionally, you may also receive the Can’t find script engine “VBScript” for script error message sometimes.
Situation 3: Windows Script Host The System Cannot Find the File Specified
You may also see a Windows Script Host window informing you that The system cannot find the file specified.
Similarly, this error occurs when the system fails to find a certain script file (*.vbs).
In addition to access being denied, can not find the script file, and the system cannot find the file specified mentioned above, there are also other possible error messages indicating the Windows Script Host error:
- Not enough storage
- Not enough memory
- Blocked by group policy
- The parameter is incorrect
- Etc.
How to Fix Windows Script Host on Windows 10
When your computer occurs a Windows Script Host error, you are supposed to find solutions. Here we compile several practical methods for you. But before this, we advise you to take good care of your data first.
Here we provide two options for you to manage your data. MiniTool ShadowMaker is a professional software to back up all important drives, systems, files, and folders on your computer. It allows you to make differential and incremental backup schemes which can avoid duplicated backups. Besides, it contains a file sync function that can back up files to multiple locations simultaneously. You can find more functions about this software on this page. If you are looking for backup software, MiniTool ShadowMaker is a reliable one.
MiniTool ShadowMaker TrialClick to Download100%Clean & Safe
The other choice is MiniTool Power Data Recovery, a free data restore tool. It can recover lost data due to OS crashes, virus attacks, mistaken deletions, and so on. Even if you haven’t used any data recovery software before, you can easily master how to use this software because of its simple operation interface and clear introduction.
MiniTool Power Data Recovery provides comprehensive features to help you restore data. For saving your scan time, you can select specific scan locations like the desktop, Recycle Bin, and a selected folder. You can also set scan conditions like selecting file systems and file types before you start the scan process. Besides, you can recover files from external hard drives, USB flash drives, memory cards, and other data storage devices.
As a professional data recovery software, MiniTool Power Data Recovery causes no damage to your files. Why not have a try?
MiniTool Power Data Recovery FreeClick to Download100%Clean & Safe
Recover Data with MiniTool Power Data Recovery
Step 1: Click the button below to download MiniTool Power Data Recovery.
MiniTool Power Data Recovery FreeClick to Download100%Clean & Safe
Step 2: Initialize the setup program to finish the installation process of MiniTool Power Data Recovery. Then, run this data recovery software to see the main interface.
Step 3: Select a proper option from the top of the software’s main interface.
In the case where Windows Script Host goes wrong, you should:
- Select Logical Drives to recover files from a certain drive.
- Select Devices to recover files from a missing drive (you should also select this when you don’t know which drive the files are included in).
Step 4: Double-click on the target partition or the disk to perform a full scan on it. Then, wait for the scan result.
Step 5: Look through the files found by MiniTool Power Data Recovery and check the wanted files.
You can click the Preview button to check the selected files are what you want. Use Filter, Search, and Type functions to quickly locate your files.
Step 6: Click on the Save button to choose another drive/disk to store the recovered files.
Step 7: Click on the OK button to confirm your choice.
Tips:
MiniTool Power Data Recovery free edition can retrieve up to 1GB of files for free. You can get an advanced edition to enlarge the recovery capacity in this site.
Useful Ways to Fix Windows Script Host Error in Windows 10
Fix 1: Run the Microsoft Safety Scanner.
If your WSH issue is caused by malware or virus attacks, the Microsoft Safety Scanner tool is a good choice to fix your computer.
Step 1: Download the Microsoft Safety Scanner if you don’t have one.
Step 2: Install it properly on your PC.
Step 3: Disable all the antivirus software and security essentials.
Step 4: Run the Microsoft Safety Scanner to check your PC for viruses.
Step 5: Wait for the scan and do what it suggests you do.
Fix 2: Run System File Checker (SFC).
System File Checker is a useful tool to scan your Windows and fix corrupted files. When your computer can’t work as normal or encounters the error we discussed in this passage, you can try to run SFC.
Step 1: Press Win + R to open the Run window and input cmd.
Step 2: Press Ctrl + Shift + Enter at once to run Command Prompt as administrator.
Step 3: Choose Yes in the User Account Control pane.
Step 4: Type sfc /scannow and press Enter.
Step 5: Wait for the command to finish and close the window.
Step 6: Restart your computer.
Fix 3: Change the value of the .vbs key.
Step 1: Press Win + R to open the Run window.
Step 2: Type regedit and click on the OK button.
Step 3: Choose Yes in the User Account Control pane.
Step 4: Navigate Computer > HKEY_CLASSES_ROOT > .vbs.
Step 5: Right-click on the (Default) key in the right pane.
Step 6: Choose Modify… from the context menu.
Step 7: Change the Value data into VBSFile.
Step 8: Click on the OK button to confirm.
Step 9: Close Registry Editor and reboot your PC to let changes take effect.
Fix 4: Delete entries after Userinit.exe
If you encounter a Windows Script Host error on startup, you can try this method to solve it.
Step 1: Press Win + R to open the Run window.
Step 2: Type regedit and press Enter to open Registry Editor.
Step 3: Navigate to Computer > HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows NT > CurrentVersion > Winlogon.
Step 4: Delete any entries you find after the Userinit.exe. For example, VMApplet and WinStationsDisabled in the following interface.
Step 5: Double-click on Userinit.exe and make sure the default value is C:\Windows\system32\userinit.exe.
Step 6: Close Registry Editor and reboot your PC to let changes take effect.
Please note that you can also try to delete the *.vbs entry when meeting Windows Script Host error on startup.
Fix 5: Run System Restore
You may find the Windows Script Host error occurs when you boot the computer or while you’re using it. Both situations mean the error is caused by recent computer use. If you have created system restore points before, you can restore your system to a previous state to solve this problem.
Step 1: Press Win + R to open the Run window.
Step 2: Input control and click Enter to open the Control Panel.
Step 3: Select Large icons under the View by tab to find the Recovery choice.
Step 4: Choose Open System Restore and select a restore point in the pop-up window.
Fix 6: Rely on Repair Install.
If you have tried all the methods above but the issue still exists, this method should be your last resort. Windows reinstallation can reload the system files and registry keys, which will surely fix the Windows Script Host error and repair the corrupt system files.
For detailed operations about how to reinstall Windows 10, you can go to this article: How to Reinstall Windows 10 without CD/USB Easily (3 Skills)
How to Disable Windows Script Host in Win10
According to the report, some HTML malware will use WSH objects. Therefore, Windows users who don’t need this feature prefer to disable it. You can disable it with the next steps.
Step 1: Open the run dialog box the way you like.
Step 2: Type regedit and click on the OK button.
Step 3: Choose Yes in the User Account Control pane to open Registry Editor.
Step 4: Find the Enabled value under HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings.
Step 5: Double-click on Enabled from the right-hand pane.
Step 6: Set the Value data to 0 and click the OK button.
Tips:
Please be advised that you won’t be able to run any scripts using WSH after disabling it (VBScript and JScript scripts are included).
How to enable the Windows Script Host again? Definitely, you should change the Value data of Enable key to 1. If you find Windows Script Host Enable key missing, please create a key by yourself.
Conclusion
Windows Script Host errors can occur occasionally, but they can be easily resolved. If you run into this error, please try the above methods to fix it. When you find data lost after the error is fixed, please try MiniTool Power Data Recovery to retrieve them.
MiniTool Power Data Recovery FreeClick to Download100%Clean & Safe
If you have any problem in using the software, please let us know via [email protected].
Contents
- What Is a Windows Script Host Error?
- How to Fix a Windows Script Host Error in Windows 10
- 1. Run the System File Checker
- Running the SFC Command in Safe Mode
- 2. Scan Your Hard Disk for Problematic Sectors Using the CHKDSK Utility
- Checking Your Disk via File Explorer
- Checking your disk via Command Prompt
- 3. Run a Full Malware Scan
- 4. Run the Microsoft Safety Scanner
- 5. Perform a Clean Boot
- Easier Way to Isolate the Responsible Program
- 6. Return the Default Value of .vbs to VBSfile in the Registry Editor
- How to Back Up the System Registry
- Here’s How to Change the Default Value of .vbs:
- How to Delete the VMApplet and WinStationDisabled strings in the Registry Editor.
- 1. Run the System File Checker
- Conclusion
- FAQ
- How to Remove Windows Script Host Error in Windows 7?
- What is Windows Script Host?
- What are Windows Script Host Settings?
- What Is a Script Error?
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 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.
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.
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, 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.”
- 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.
- Once the DISM tool has completed its job, go to a new line and type “sfc /scannow” (no quotes) into the Command Prompt window, then press “Enter.”
- 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.
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
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, which is not guaranteed always to 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 won’t occur again once you’ve managed to get the file via other means.
Two main ways to run the CHKDSK utility are via the File Explorer and in an elevated Command Prompt window.
Related: How to Check For and Fix Disk Errors with CHKDSK Command
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.”
- Switch to the right pane and right-click on the drive where Windows is installed.
- Click on “Properties” in the context menu.
- When you see the Properties dialog window, head to the “Tools” tab, then 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.
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 fished out. However, you can use an anti-malware program to search and delete malware infections.
You can check out Auslogics Anti-Malware software to thoroughly scan folders and restricted areas where the malware program might be hiding.
Learn more from this program here: Auslogics Anti-Malware: Features and Reviews.
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.
- Next, click on “Virus & Threat Protection.”
- Once the “Virus & Threat Protection” window appears, click on Scan Options.
- When you reach the “Scan Options” page, select the Full Scan option, then click the “Scan Now” button.
- 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
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. You can run it when you’re less busy rather than stick to your computer while it runs.
- 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.
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 get in the way of the Windows Script Host and trigger the startup error you see. You can find the responsible program by performing a clean boot.
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 logo + 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.
- 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.
- Now, click on the “Disable All button.”
- Next, head to the “Startup” tab and click “Open Task Manager.”
- 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.
- 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.
Also Read: Quick Tips: How to Disable Startup Programs in Windows 10
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.
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.
Also Read: What is the Windows Registry And Why Do You Need a Registry Cleaner?
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.
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.
- When the Registry Editor opens, go to the window’s top-left corner and click on File.
- Select Export from the context menu.
- 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! When restoring the registry, open the Registry Editor and click on File >> Import. 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.”
- Under HKEY_CLASSES_ROOT, click on .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” (no quotes) and click on OK.
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, we’ve covered the solutions in this guide.
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), looking for and getting rid of any 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
How to Remove Windows Script Host Error in Windows 7?
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.
What is Windows Script Host?
With the help of Windows Script Host, you can 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.
What are Windows Script Host Settings?
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.
What Is a Script Error?
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.
When visiting websites with interactive elements that employ JavaScript, script errors are frequently encountered. They may appear as pop-up error warnings or may be recorded in the browser developer console.
For the most part, Windows is a rather stable OS with relatively few issues. However, a few major bugs and issues keep popping up from time to time.
In this article, we’re going over the Windows Script Host error, what it means, and what can you do to fix it?
What is the Windows Script Host error?
The error might seem like malware infection or virus at first, but more often than not, this error is triggered by an issue with the VBS script file. There are a couple of other possible reasons for this as well.
- Malware infection: While less likely, this error can be triggered by a malware or virus infection as well.
- Registry errors: Corrupted or damaged regisry files can also trigger the error.
Also read: Windows could not automatically detect this network’s proxy settings: 10 Fixes
There are a couple of things you can do to get rid of this error. Try out the following solutions.
Run an SFC scan
Corrupt files are the number one reason why your PC might be behaving weirdly. Here’s how you can get rid of them and potentially resolve your issue.
Step 1: Press Windows Key + S to bring up the Cortana/Search box and search for Powershell. Open Windows Powershell from the search results.
Step 2: Type sfc /scannow to scan your system for issues.
Step 3: If the SFC scan finds any problem, use the following command to resolve them.
DISM /Online /Cleanup-Image /RestoreHealth
Restart your PC, and the Windows script host error should be gone.
Revert to the default VBS value
Resetting the VBS value can also get rid of the issue. Here’s how.
Step 1: Press Windows Key + R to open the Run prompt. Type regedit and hit enter.
Step 2: Navigate to the following directory.
HKEY_CLASSES_ROOT/.vbs
Step 3: Double-click the (Default) key and change its value to VBSfile.
Now restart your PC, and the Windows script host error should be fixed.
Also read: How to set an alarm for 10 minutes?
Delete Registry entries
By deleting Registry entries associated with the error and restarting your PC, you can force Windows to recreate the files in question, potentially resolving the issue.
Step 1: Press Windows Key + R to open the Run prompt. Type regedit and hit enter.
Step 2: Navigate to the following directory.
HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/Winlogon
Step 3: Delete all registry entries after userinit.exe
Now restart your PC, and it should work fine.
Delete the startup .vbs entry
Boot into Windows safe mode and try deleting the *.vbs entries that are used at startup. Here’s how.
Step 1: Press the Windows key and search for Safe Mode. Click the corresponding search result.
Step 2: Under Advanced startup, click on Restart now.
Step 3: When your PC reboots, click on Troubleshoot.
Step 4: Head over to Advanced Options.
Step 5: Select Startup Settings.
Step 6: Click the Restart button.
Step 7: Open the Registry editor and search for nameofthe.vbs. Once you’ve found a file, double-click it and carefully delete the VBS file path. Repeat this step until all instances of the path are deleted.
Step 8: Open Windows Explorer, search for the VBS file and delete that file as well.
Now restart your PC, and you should be able to get around the Windows script host error.
Also read: How to change the primary monitor in Windows 10?