Take a look at some WSH built-in properties in the following example:
var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = '';
s = s + 'WScript.Version = ' + WScript.Version + '\n';
s = s + 'WScript.BuildVersion = ' + WScript.BuildVersion + '\n';
s = s + 'ScriptEngineMajorVersion = ' + ScriptEngineMajorVersion() + '\n';
s = s + 'ScriptEngineMinorVersion = ' + ScriptEngineMinorVersion() + '\n';
s = s + 'ScriptEngineBuildVersion = ' + ScriptEngineBuildVersion() + '\n';
s = s + WScript.FullName + ' version = ' + fso.GetFileVersion(WScript.FullName) + '\n';
WScript.Echo(s);
The code gives output for me:
WScript.Version = 5.8
WScript.BuildVersion = 18283
ScriptEngineMajorVersion = 5
ScriptEngineMinorVersion = 8
ScriptEngineBuildVersion = 18231
C:\Windows\System32\WScript.exe version = 5.8.7601.18283
The point is you can retrieve WSH version that ways (though I have no idea about the difference in WScript.BuildVersion
and ScriptEngineBuildVersion
).
There are WSH versions 1.0, 2.0 (also called 5.1), 5.6, 5.7, 5.8 and 5.812 by the link. Сonsidering JScript version is the same as WSH (except JScript 5.1 is for WSH 2.0, and perhaps - I haven't found any proof - JScript 9.0 is for WSH 5.812, since JScript 9.0 introduced with IE 9 and later WSH 5.812 with Windows 10). You can find JavaScript and JScript versions correspondence by the link 1 and link 2.
Based on that I suppose the following compatibility:
WSH JavaScript
1.0 1.0
2.0 1.4
5.5-5.8 1.5
5.812 1.8.1 (needs to be checked)