Fix- Windows script host error in windows 10/11

Are you seeing an error message like “Windows Script Host access is disabled on this machine.” while running a script on your computer? If you are indeed facing this issue, there is a very simple registry fix for this problem. Just follow these easy steps

Fix 1 – Running sfc and Dism commands

1 – Type cmd in taskbar search box and do a right click on cmd icon which appears. Click on run as administrator

CMD ADMIN min

2 – Now, type the commands given below.



SFC /scannow

After the command gets executed fully, run the command shown below

DISM/Online/Cleanup-Image/RestoreHealth

2 – After the completion of the command close the window

Fix 2 – Modify Registry Editor

You need to enable Microsoft Script Host on your computer through Registry Editor.

NOTE

After opening Registry Editor, click on “File” and then on the “Export” to create the backup.

If anything goes wrong you can retrieve your registry simply by importing the backup.

1. Click on the Search box and then type “regedit“.

2. Then, hit ‘Enter‘ key from the keyboard

 

Regedit New Press Enter

 

3. Go to this location-

Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows Script Host\Settings

 

4. On the right-hand side of the window, double click on “EnabledDWORD value.

 

Double Click Enabled

 

5. Set the ‘Value data:‘ to “1“.

6. Now, click on “OK” to save the change.

 



Set The Data Ok

 

Close Registry Editor window.

Reboot your computer.

That’s it! After rebooting your computer you can easily run any script without any error. Your problem is solved.