Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6355477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:46:21+00:00 2026-05-24T22:46:21+00:00

Using .NET, I can write an app that hosts a scripting engine that complies

  • 0

Using .NET, I can write an app that hosts a scripting engine that complies with Microsoft’s IActiveScript conventions. This includes JScript and VBScript from Microsoft, and also PerlScript, RubyScript and I don’t know what else from third-parties.

The way to do it in code is something like this:

    Type engine = Type.GetTypeFromProgID(progId, true);
    _engine = Activator.CreateInstance(engine) as IActiveScript;

where the progId can take the value Javascript, JScript, ECMAScript, VBScript, and others. You can do something similar when running cscript.exe, specifying the progId on the command line with the //E option. For example, this command:

cscript.exe  <file>  //e:JScript

..will run the specified file, regardless of its extension, through the JScript engine.

On my machine, if I look in HKLM\SW\Classes\ , the three progIds {Javascript, JScript, ECMAScript} all point to the same CLSID, which I guess is the JScript 5.8 script engine: {f414c260-6ac0-11cf-b6d1-00aa00bbbb58}

Is there a ProgId or CLSID I can specify to run IE9’s Javascript engine, aka “Chakra”?

Does IE9’s engine still get loaded by IActiveScript?
Microsoft’s documentation suggests that it does, but does not specify a ProgId or CLSID.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:46:21+00:00Added an answer on May 24, 2026 at 10:46 pm

    The CLSID for the Chakra Javascript engine installed with IE9 is
    {16d51579-a30b-4c8b-a276-0ff4dc41e755}.

    The InProcServer32 is %windir%\System32\jscript9.dll .

    There is no ProgId that I could find. That’s a bit odd; normally paired ProgId and CLSID entries refer to each other. For a given COM object, the ProgId key in the registry has a subkey called CLSID, and the CLSID registry key has a subkey called ProgId, and they refer to each other. But the ProgId subkey for the IE9 CLSID is “JScript”, which of course refers to the v5.8 Jscript CLSID. Not sure if this was a mistake by Microsoft, or a purposeful bit of obfuscation, because they don’t want anyone using the Chakra engine outside of IE9. Looks purposeful to me.


    I learned of the CLSID by just searching the registry for jscript9.dll .


    If you have .NET code that hosts scripting engines, you can instantiate the IActiveScript object for the IE9 javascript engine (“Chakra”) by using the CLSID directly. The code needs to be something like this:

    private const string clsIdPattern =
        @"^(?<curly>\{)?[a-zA-Z0-9]{8}(?:-[a-zA-Z0-9]{4}){3}-[a-zA-Z0-9]{12}(?(curly)\})$";
    
    public ScriptEngine(string language)
    {
        if (language == null)
            throw new ArgumentNullException("language");
    
        Type engineType = null;
    
        if (Regex.IsMatch(language, clsIdPattern))
        {
            // it's a CLSID
            var guid = new System.Guid(language);
            engineType = Type.GetTypeFromCLSID(guid, true);
        }
        else
        {
            // assume vanilla progId
            engineType = Type.GetTypeFromProgID(language, true);
        }
    
        var engine = Activator.CreateInstance(engineType) as IActiveScript;
    

    In the above, clsIdPattern is a regular expression that matches the familiar GUID format, either with or without surrounding curlies.

    Given the code above, you could pass “jscript”, “Javascript”, or “ECMAScript” and get the v5.8 JScript engine. Or you could pass “{16d51579-a30b-4c8b-a276-0ff4dc41e755}” and get the IE9 Javascript engine. Obviously you need to have IE9 installed in order for this to work.

    I just tried this and it works for simple cases. I’ll be playing with that some more, real soon.


    If you want to run Chakra from WSH, like from cscript.exe, then you will need a ProgId, I think.
    If I create “Chakra” as a Progid in the registry, referring to the correct CLSID, I can run JS files through IE9’s engine like this:

    cscript.exe  module.js  //E:Chakra 
    

    For example, after inserting the new “Chakra” ProgId, given a script like this:

    WScript.Echo( ScriptEngineMajorVersion() + "." +
                  ScriptEngineMinorVersion() + "." +
                  ScriptEngineBuildVersion());
    

    …the output is like this:

    C:\dev\js>Version.js
    5.8.16982
    
    C:\dev\js>cscript.exe Version.js  //E:Chakra
    9.0.16434
    

    And here’s the result of a test of AES encryption in Javascript, comparing Chakra with JScript 5.8:

    C:\dev\js\SlowAES>cscript.exe test.aes.js
    AES encryption in Javascript.
    password  : Albatros1
    salt      : saltines (73616c74696e6573)
    iterations: 1000
    key       : 172,52,20,51,98,71,49,195,14,31,141,51,129,8,94,66
    iv        : 212,27,28,156,83,245,0,35,176,157,45,141,209,143,158,248
    plaintext : Hello, /r/javascript.
    ciphertext: fdebac9f1ed1a13bac58f3cc6558e8b0367a94245dbbfe53cacc4979799fc182
    decrypted : Hello, /r/javascript.
    elapsed   : 5011ms
    
    C:\dev\js\SlowAES>cscript.exe test.aes.js //E:Chakra
    AES encryption in Javascript.
    password  : Albatros1
    salt      : saltines (73616c74696e6573)
    iterations: 1000
    key       : 172,52,20,51,98,71,49,195,14,31,141,51,129,8,94,66
    iv        : 212,27,28,156,83,245,0,35,176,157,45,141,209,143,158,248
    plaintext : Hello, /r/javascript.
    ciphertext: fdebac9f1ed1a13bac58f3cc6558e8b0367a94245dbbfe53cacc4979799fc182
    decrypted : Hello, /r/javascript.
    elapsed   : 2593ms
    

    To set the ProgId in my registry, I used this:

    Windows Registry Editor Version 5.00
    
    [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]
    

    and to unexpose Chakra, or revert the registry, I did this:

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{16d51579-a30b-4c8b-a276-0ff4dc41e755}\ProgID]
    @="JScript"
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{16d51579-a30b-4c8b-a276-0ff4dc41e755}\ProgID]
    @="JScript"
    
    [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Chakra]
    

    This registry script worked with x64 Windows; if you don’t have x64, then you’ll need to remove the WOW6432Node lines.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using .net. Is there some code somewhere that can change $11,456.50 -> eleven
I want to start using .NET 3.5 features in an app that is currently
Can a LINQ enabled app run on a machine that only has the .NET
I know that I can load an app.config file from a different location using
Using .Net (C#), how can you work with USB devices? How can you detect
When using .NET's WebBrowser control, how can I get the entire HTML of the
How can I modify the PDF document properties programmatically using .NET code? I have
How can I create a local user account using .NET 2.0 and c# and
How can I monitor instant messages received on gtalk using .NET? Basically, I need
I am building a web site in C# using asp.NET MVC How can I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.