[Fix] Windows Script Host Access is Disabled on this Machine

When you run a Windows script using wscript.exe or cscript.exe, error Windows Script Host access is disabled on this machine may pop-up. However, in systems affected by malware, the error appears at regular intervals, without any script invocation by the user.

So the key questions are:

  1. Which script is being run that causes the error message?
  2. How do I enable Windows Script Host access in the machine?

This post address those questions.

[Fix] Windows Script Host Access is Disabled on this Machine

If the message “Windows Script Host access is disabled” appears at every startup or in regular intervals without you doing anything, then a malware script (.vbs, .js or .wsf) may be trying to run in the background, and is prevented by Windows Script Host restriction in effect in your system, which is very good. In such cases, your aim should be to eliminate the malware from the system completely rather than fixing the script host error message.

Run a thorough malware scan in your system first. Until every trace of malware is removed, do not lift the script host restriction. The restriction is only protecting your system.

Investigate which script is trying to run that causes the error?

If the error appears without you manually launching a script, then it’s possible that a malware script is trying to run in the background, probably as a scheduled task.

Use Task Manager to find the script file name

You can use a simple tool like Task Manager to find out the script file name that’s being executed. Use these steps:

  1. Let the script error window be on the screen. Don’t dismiss it yet.
  2. Disconnect your computer from the internet.
  3. Open Task Manager (Ctrl + Shift + Esc) and click the Details tab.
  4. Right-click the column header, click Select Columns.

    task manager show command line

  5. Enable the Command line checkbox and click OK.
    task manager show command line

    RELATED: Check out post Configure Task Manager to display full path of running processes for more information and screenshots.

    This shows the complete path and file name of the script file which is trying to run silently. In this example, a script file named protect.vbs is trying to run from the %TEMP% folder of the user profile.

    windows script host access is disabled on this machine

    Related: Process Explorer from Windows SysInternals can be used to find the process name, path and full arguments. Check out post How to Find Which Program Caused An Unknown Error Message? for details.

Use Advanced Troubleshooting Tools

Further, you can use Autoruns, another excellent tool from Microsoft Windows SysInternals to find the startup launch-point (Startup or Task Scheduler) used by that malware script.



Start your investigation from there. If you’re an advanced user, you can even edit the script file using Notepad and see what code is being executed. Ransomware usually employs .vbs, .js, .wsh or .hta files to download the crypto-ransomware payload from a remote server, run it on your local system and encrypt your data or erase them completely.

First of all, if someone could drop a malware script in your TEMP directory and launch it, then there exists some really serious vulnerability in your system. Antivirus and anti-malware protection may not always help if your system is vulnerable to an exploit. You should make sure that your system is up to date in terms of Windows Update patches, as well as updates for the programs you’re using in your system.

Do a thorough checkup using a reputed anti-malware tool such as Malwarebytes.

How do I enable Windows Script Host access?

If your system is not connected to a domain, here are the steps to remove the error “Windows Script Host Access is Disabled”. This procedure will enable running Windows Scripts (.vbs or .js) on your system.

Enable Windows Script Host access using the Registry Editor

  1. Press WinKey + R to bring up the Run dialog.
  2. Type regedit.exe
  3. Delete the value named Enabled in following keys:
    HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows Script Host\Settings
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Script Host\Settings

    Windows Script Host access is disabled on this machine
    If a key doesn’t exist, ignore and check the next key.

  4. Exit the Registry Editor.

Enable Windows Script Host access using command-line

To do this using command-line, execute these commands from elevated Command Prompt:

REG DELETE "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled /f
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled /f

With the Windows Script Host restrictions lifted, you should only run scripts from trusted sources and if you’re sure they are safe to run.

That’s it! This enables Windows Scripting host on your computer.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

35 thoughts on “[Fix] Windows Script Host Access is Disabled on this Machine”

  1. for many period of time pc saying window script host is disabled on this machine. for the error i tried to sove many time but i can’t. would like to help me why this problem is happened and how can i solve this problem. and also would you tell me the use of this script. for your help i say thanks.From bilisumma!

    Reply
  2. REG DELETE “HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings” /v Enabled /f

    after executing this in cmd .. the output was access denied

    Reply
  3. Innocent Shange I am experiencing the same issue, to remove blank screen, press Ctrl+Alt+Del, go to task manager, file, new task, then type “explorer.exe”. This should bring up your windows explorer. N.B You will have to do this upon every restart, until you enable it in the registry

    Reply
  4. i am experiencing this problem.. should i update my anti-virus and do a full scan to solve this..?? considering the fact that apparently it is caused by a malware disabling the script host

    Reply
  5. Good day! Thanks for this, but what if the home screen is just in a black out mode, I can only see the cursor, what would be the solution for this? Thanks.

    Reply
  6. I’m facing this issue and its starting to get on my nerves as I can’t run driverspack solution, I’m using windows 8.1 by the way. My problem is that there is no “Enabled” file or button to click on in the settings folder of the Windows Script Host. Can someone please help me work this out asap.

    Thanks in advance

    Reply
  7. Thank you first of all, i tried from so many sources to enable script host but no one has worked out, but your trick has worked.

    Reply
  8. i hv issue with windows script host, but after changing it following the process, its still given the same response saying “enable your window script host, pls help on this

    Reply
  9. Thanks a lot brother. This article has helped me resolve the windows script host issue and I have been able to activate my MS Word 2016 successfully.

    Thanks a lot.

    Reply
  10. Wow thank u a lot🙏 the command has just worked on my windows 7 ultimate. Wanted to prolong time required to activate since i got it online. As am looking forward to fully activate it. Thanks thanks for the good work

    Reply
  11. I have managed to resolve the “Windows script host access disabled” error by following the procedure displayed on your page. I deleted the the registry line as you advised.
    It worked well for me. I am now able to install the software.
    Thank you so much!!! I am grateful for you help.

    Reply
  12. I did all of the mentioned instructions but still could not run the scriot to install the driver to my USB wifi dongle, until I noticed a notification in the try stating that the anti malware / antivirus app is actually blocking the script from running. I’d disable the protection for a while before trying other steps that may appear to be a bit technical to noobs.Thank you..just my10cent of contribution, hoped it helps

    Reply

Leave a Comment