Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Using jscript9 instead of jscript

Aug
2,217
101
ver.js
Code:
WScript.Echo( ScriptEngineMajorVersion() + "." +
              ScriptEngineMinorVersion() + "." +
              ScriptEngineBuildVersion());

Normally, cscript.exe uses the jscript.dll by default.

In order to use the jscript9.dll with cscript.exe,
the jscript9 engine must be used as a command line option.

Doing a search of the registry for jscript9.dll,
I found the ClsID;
Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{16d51579-a30b-4c8b-a276-0ff4dc41e755}\InprocServer32

The ClsID can be used as the command line engine option...
Code:
R:\>#cscript.exe ver.js
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

5.8.16384

R:\>#cscript.exe ver.js //E:{16d51579-a30b-4c8b-a276-0ff4dc41e755}
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

11.0.16384

R:\>#set _jscript9={16d51579-a30b-4c8b-a276-0ff4dc41e755}

R:\>#cscript.exe ver.js //E:%_jscript9
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.

11.0.16384

Posting for my future reference,
but others might also be interested.

Joe
 
Back
Top