The WSH Engine

The Windows Script Host engine is installed by default in Windows versions since Windows '98. By default, when running .js files it uses the JScript engine, at the version currently patched by the Windows Update system.

This is the engine that is used in IE5-IE8. To simulate a version of the engine based on a browser, you can use a VM upgraded to the version of IE that you are targeting.

Since IE9, Internet Explorer uses the Chakra engine instead. To tell the Windows Script Host to use this engine instead of the JScript engine can be accomplished in one of two ways.

First off, we need the CLSID for the Chakra engine: {16d51579-a30b-4c8b-a276-0ff4dc41e755}

Then, to use the Chakra engine only temporarily, you can specify the //E (engine) parameter: cscript.exe //E:{16d51579-a30b-4c8b-a276-0ff4dc41e755}

For a more permanent solution, you can modify the registry to include and specify a ProgID for Chakra: [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{16d51579-a30b-4c8b-a276-0ff4dc41e755}\ProgID] @="Chakra" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{16d51579-a30b-4c8b-a276-0ff4dc41e755}\ProgID] @="Chakra" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Chakra] @="JScript Language" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Chakra\CLSID] @="{16d51579-a30b-4c8b-a276-0ff4dc41e755}" [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Chakra\OLEScript]