JavaScript version used by the Windows Scripting Host JavaScript version used by the Windows Scripting Host windows windows

JavaScript version used by the Windows Scripting Host


Its a common mistake to make but the Windows Scripting Host supports VBScript and Microsofts own JavaScript implementation called JScript based on the ECMAScript standard. In fact, it can support a number of scripting implementations through its support for Active Scripting languages.

While it shares many similarities with JavaScript, they are not the same (yes, they came from the same place, but that doesn't mean they didn't diverge afterwards). When you use .js files outside of the internet browser (the only browser to support Active Scripting was early versions of Internet Explorer, pre Edge) they are executed using a host program, in this case the Windows Scripting Host. This also applies when using .wsf files.

Edit: I've also updated the tag info as it states can be used, which is incorrect and why so much confusion arises around this topic.


Useful Links


i started heavily studying Jscript about 2 years ago. From my experience

  • no classes
  • no imports
  • no Lambas
  • no "let"
  • no "const"
  • no fun

this is the state of what JS looked like when i first began programming back in 2012. At this time all the above features was the gonna be the next big thing in EcmaScript 6.

So my educated guess would be EcmaScript 5.

you can still make classes with the traditional ES5 syntax.

function FunctionButClass(a,b){    this.Square = function(){ return a*b; }}var squared = new FunctionButClass(4,4).Square();

the prototype syntax works as well.

function PrototypeSyntax(a,b){    this.a = a;    this.b = b;}PrototypeSyntax.prototype.Square = function(){    return this.a*this.b;}

also note that the entirety of the DOM is absent, so no document.getElementById("") everything is run through the WScript.CreateObject("")

note2: the DOM IS available in Jscript through .HTA files. But remember

WScript.CrateObject("Scripting.FilesSystemObject");

now becomes:

new ActiveXObject("Scripting.FilesSystemObject")