In Windows WHS or Windows Scripting Host is a Windows administration tool that provides scripting abilities comparable to batch files, but with a wider range or supported features. This is a built-in feature which is available in all the version of windows since windows 98. By default, this feature is enabled in the Windows operating system. Windows Scripting Host provides an environment, in which users can execute scripts in a variety of languages. Is language independent so that users can run the script in different languages from both the Windows desktop and the command prompt. Windows Script Host is ideal for non-interactive scripting needs, such as logon scripting, administrative scripting, and machine automation.
WSH provides improved systems administration capabilities using the WSH Object Model. This runtime library includes objects, methods, and properties that you can use to map network drives or printers, retrieve and modify environment variables, create shortcuts, and read from and write to the Registry. You can use these functions to create logon scripts, configure users’ desktops, create custom installation or configuration scripts, or perform other simple tasks. By default WSH included with two script engines. Visual Basic scripting and JavaScript scripting.
WScript.exe (Windows Based)
CScript.exe (Command Based)
And most of the time this WSH will be enabled by default in windows, and some windows applications and processes use these scripts to automate some processes, This leads to the biggest security concern, Viruses and malware could be written to exploit this ability. So in some organization WSH is disabled by Policy, By using Software Restriction Policies introduced with Windows XP, a system may be configured to execute only those scripts which are stored in trusted locations, have a known MD5 hash, or have been digitally signed by a trusted publisher, thus preventing the execution of untrusted scripts. In this article we will see which cause Windows Script Host Access is disabled on this system error.
Whenever you run a windows script using wscript.exe or cscript.exe, If you face Windows Script Host Access is disabled on this system, then you need to check this feature is enabled on your system or not, If its enabled then go to further troubleshooting. In Two ways you may get this error, first, you may get this error, while manually running Scripts. Or It may appear automatically at every startup of the computer. So If you get this error manually While Running scripts, then the only possible reason for this is to check the WSH feature is enabled in the system or not. If not enable the Feature by following the steps below.
Open run command by pressing windows + R and type regedit and hit enter this will open the registry editor.
Now navigate to the following path.
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings
From the Left-hand side click on the Settings. Now from the Right-hand side, you can see Enabled DWORD. If you are not able to see, then you need to create the Registry key.
Right-click on the empty space from right-hand side. Choose New > DWORD (32-bit), Name the Value Enabled and give OK.
Double click on the Enabled DWORD and set the value to 1 and give OK.
To enabled Windows Host Script – 1
To Disable Windows Host Script – 0
Restart the system once to make it effective. So if you are getting the “Widows Script Host Access is disabled on this system” error automatically then Check which Script is causing this error?
Check which Script Causing this error:
You can use Task Manager to check which script is causing this error. Open Task Manager by pressing Ctrl + Shift + Esc. And click on Details Tab.
Right-click on the columns Tab and choose select Column, Once you Choose Select Column you will get a separate window, look for command line check Box, Check that Box and Give Ok
Now you will get the Command line tab where you can see the Path of that script, Find that script and delete it. Or you can enable the WSH feature on your system, So that if any script which runs automatically will run without any error.
Enable WSH using command Line.
Open command Prompt in admin mode and run the following command and hit enter.
REG DELETE “HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings” /v Enabled /f REG DELETE “HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings” /v Enabled /f
This commands enable the WSH from the user perspective and also from computer perspective.