issue with jscript.dll after upgrading from windows 11 23H2 to Windows 11 24H2

CHABE Sylvie 40 Reputation points
2024-10-10T14:35:08.4933333+00:00

Hello,

After upgrading from Windows 11 23H2 to Windows 11 24H2, we encounter an issue by executing the following script :

Dim jsonString
jsonString = "{""name"":""John"", ""age"":30, ""city"":""New York"", ""array"":[{""name"":""toto""},{""name"":""titi""}]}"

Dim sc
Set sc = CreateObject("MSScriptControl.ScriptControl")
sc.Language = "JavaScript"

' Define JS function to parse the json
sc.AddCode "function parseJSON(json) { return eval('(' + json + ')'); }"

' call the function to parse JSON
Dim jsonObject
Set jsonObject = sc.Run("parseJSON", jsonString)

' Accéder aux données du JSON
WScript.Echo "Type: " & TypeName(jsonObject)
WScript.Echo "Object: " & jsonObject
WScript.Echo "Name: " & jsonObject.name
WScript.Echo "Age: " & jsonObject.age
WScript.Echo "City: " & jsonObject.city

For Each elt In jsonObject.array
  WScript.Echo "Array elt: " & elt.name
Next

' Clean
Set sc = Nothing

Everything works correctly except the following:

For Each elt In jsonObject.array

  WScript.Echo "Array elt: " & elt.name

Next

it used to work in 23H2 and it does not work anymore.

This seems to be explained in this thread:

https://admx.help/?Category=Windows_11_2022&Policy=Microsoft.Policies.InternetExplorer::JScriptReplacement

if you set the parameter to disable, you load jscript.dll instead of the legacy dll.

How does it come the legacy dll is the default ?

this is a breaking change for all our customers and we need a fix from Microsoft that will not accept to change the regedit.

Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. CHABE Sylvie 40 Reputation points
    2024-10-14T09:22:06.86+00:00

    Hello Daisy,

    I am sorry but I do not understand why it is by design since it was working before. This is rather a regression for which we would like a fix to be delivered.

    The problem is that the json object component from Jscript.dll does not implement _NewEnum function as far as interop objects are concerned.

    This is a bug.

    As far as I know, no KB exists explaining this issue and nowhere it is said this functionnality is no more supported..

    You can imagine we cannot ask our customer to rollback to an old windows release. In the same way, modifying the GPO could only be acceptable for our customers if it is recommended by Microsoft and for sure some of them will not accept to change de GPO.

    So we need a fix.

    Regards

    Sylvie

    2 people found this answer helpful.
    0 comments No comments

  2. Anonymous
    2024-10-14T08:56:10.38+00:00

    Hello CHABE Sylvie,

    Thank you for posting in Q&A forum.

    According to your description, this behavior looks it is by design.

    If you still want to jscript .dll by default, I suggest roll back to 23H2 or modify GPO temporarily.

    And use Windows Feedback Hub to submit your suggestions. If you are part of the Windows Insider Program, your feedback can help shape future updates. You can provide feedback on Insider Preview builds through the Feedback Hub as well.

    Send feedback to Microsoft with the Feedback Hub app - Microsoft Support

    I hope the information above is helpful.

    If you have any questions or concerns, please feel free to let us know.

    Best Regards,

    Daisy Zhou

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.