Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Contact
  • Reviews
  • Toggle search form
Home » Windows Server » An error has occurred in the script on this page: HTA applications report a Script error after upgrading to ADK for Windows 11, version 22H2
  • wacxx
    Install Windows Admin Center in an unattended mode using a self-signed certificate Windows
  • screenshot 2020 04 23 at 00.30.09
    How to mount a USB Drive in Linux Linux
  • Webp.net resizeimage 4
    Create, list, lock, deploy, and delete Azure Resource Group via Azure CLI AWS/Azure/OpenShift
  • Drop or delete a MySQL user from phpmyAdmin
    How to delete a MySQL User Account Oracle/MSSQL/MySQL
  • screenshot 2020 03 01 at 21.19.07
    Various ways to hide Windows Taskbar Windows
  • Docker error manifest
    Docker image OS “windows” cannot be used on this platform: No matching manifest for linux/amd64 in the manifest list entries from Microsoft Docker Registry Network | Monitoring
  • banner 3
    How to Enable or Disable SuperFetch in Windows 11 Windows
  • Encryption
    How to encrypt Microsoft SQL Server Traffic Oracle/MSSQL/MySQL

An error has occurred in the script on this page: HTA applications report a Script error after upgrading to ADK for Windows 11, version 22H2

Posted on 17/10/202220/03/2024 Christian By Christian 4 Comments on An error has occurred in the script on this page: HTA applications report a Script error after upgrading to ADK for Windows 11, version 22H2
erroradkupdate

Microsoft Deployment Toolkit (MDT) is a unified collection of tools, processes, and guidance for automating desktop and server deployment. And this in turn reduces deployment time and standardizes desktop and server image deployment. In this article, you will learn how to fix an error has occurred in the script on this page: HTA applications report a Script error after upgrading to ADK for Windows 11 version 22H2. Please see the following related articles: How to check the version of Windows ADK, How to get the Windows 10 Version 22H2 Update, and how to create a Windows 10 or 11 bootable USB with UEFI support.

MDT builds on top of the core deployment tools in the Windows Assessment and Deployment Kit (Windows ADK). Its additional guidance and features are designed to reduce the complexity and time required for deployment in an enterprise environment.  Also, see How to correctly uninstall and upgrade Windows Assessment and Deployment Kit, Windows Preparation Environment, and Microsoft Deployment Toolkit.

What is the reason for this error ‘An error has occurred in the script on this page”?

After you updated your WinPE for Windows 11, version 22H2. HTA applications stop working and a message box is displayed: Script Error – An error has occurred in the script on this page. In this guide, I will be providing you with the steps to fix this issue and its limitations with the Microsoft Deployment Toolkit (MDT).

An HTML Application (HTA) is a Microsoft Windows program whose source code consists of HTML, Dynamic HTML, and one or more scripting languages, such as VBScript or JScript. The “HTML” is used to generate the user interface, and the scripting language is used for the program logic.

An HTA executes without the constraints of the internet browser security model. In fact, it executes as a “fully trusted” application. HTA applications rely on MSHTML and starting with Windows 11, version 22H2, the default legacy scripting engine was changed. To work around this issue you need to add the following registry value in WinPE:

reg.exe add "HKLM\Software\Microsoft\Internet Explorer\Main" /t REG_DWORD /v JscriptReplacement /d 0 /f

You may want to read this blog post “Install ADK, MDT, and WDS: How to deploy Windows images via Microsoft Deployment Toolkit and Windows Deployment Services“.

What is Windows PE (WinPE)?

Windows PE (WinPE) is a small operating system used to install, deploy, and repair Windows desktop editions. Windows Server, and other Windows operating systems.

Here are some interesting guides: How to correctly upgrade Windows Assessment and Deployment Kit, Windows Preparation Environment, and Microsoft Deployment Toolkit,  How to Add Packages to Windows image the DISM Tool, and how to add languages to Windows image using DISM and PowerShell.

Implement this change in MDT to solve the issue

To enable this change in MDT, we recommend that you back up the following file and modify it as follows: 

C:\Program Files\Microsoft Deployment Toolkit\Templates\Unattend_PE_x64.xml
modifiedunattended

All you have to do is to modify it as follows below. Do not forget to back up the following file before modifying it.

<unattend xmlns="urn:schemas-microsoft-com:unattend">
   <settings pass="windowsPE">
       <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
           <Display>
               <ColorDepth>32</ColorDepth>
               <HorizontalResolution>1024</HorizontalResolution>
               <RefreshRate>60</RefreshRate>
               <VerticalResolution>768</VerticalResolution>
           </Display>
           <RunSynchronous>
               <RunSynchronousCommand wcm:action="add">
                   <Description>Lite Touch PE</Description>
                   <Order>1</Order>
                   <Path>reg.exe add "HKLM\Software\Microsoft\Internet Explorer\Main" /t REG_DWORD /v JscriptReplacement /d 0 /f</Path>
               </RunSynchronousCommand>
               <RunSynchronousCommand wcm:action="add">
                   <Description>Lite Touch PE</Description>
                   <Order>2</Order>
                   <Path>wscript.exe X:\Deploy\Scripts\LiteTouch.wsf</Path>
               </RunSynchronousCommand>
           </RunSynchronous>
       </component>
   </settings>
</unattend>

Note: After saving the changes, you will need to completely regenerate the boot images. To do this, right-click on the deployment share and select Update Deployment Share.

deploymentshareupdate

As you can see, the Deployment Share Update is in progress as shown below.

Updatedeploymentshare

The Deployment Update is complete. You can now take the (LiteTouchWinPE.wim) image to the Server and start a new Windows Deployment without further issues.

Updatecomple

Also, see Workaround and Permanent fix for this snap-in performed a non-valid operation and has been unloaded. See how to fix “Cannot find the computer: Fix the following error occurred while using Kerberos authentication“.

I hope you found this blog post helpful on how to fix “An error has occurred in the script on this page: HTA applications report a Script error after upgrading to ADK for Windows 11 version 22H2”. Please let me know in the comment session if you have any questions.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Pocket (Opens in new window) Pocket
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
Windows Server Tags:deployment, Microsoft Deployment Tool kit, Microsoft Deployment Toolkit (MDT), Microsoft Windows, WDS, Windows 10, Windows 11, Windows ADK, Windows Deployment Services, Windows Server 2016

Post navigation

Previous Post: WHFB Hybrid Cloud Kerberos Trust Model is now available
Next Post: Configure and validate Exclusions for Microsoft Defender Antivirus scans

Related Posts

  • How to Manage Azure Virtual Machines with Windows Admin Center and Serial Console​
    Manage Azure Virtual Machine with Windows Admin Center and Serial Console AWS/Azure/OpenShift
  • fix this PC cannot run on Windows
    How to Fix “This PC Can’t Run Windows 11” on Hyper Windows
  • Screenshot 2021 01 22 at 23.27.30
    How does Bitlocker Network Unlock work? Windows Server
  • sql server installation
    How to Install all Editions of Microsoft SQL Server 2025 Oracle/MSSQL/MySQL
  • article 1280x720.192a2586 1
    How to remove an MDT Deployment Share Windows Server
  • Screenshot 2022 04 27 at 17.51.48
    Remote Desktop Services Setup on Windows Server Windows Server

More Related Articles

How to Manage Azure Virtual Machines with Windows Admin Center and Serial Console​ Manage Azure Virtual Machine with Windows Admin Center and Serial Console AWS/Azure/OpenShift
fix this PC cannot run on Windows How to Fix “This PC Can’t Run Windows 11” on Hyper Windows
Screenshot 2021 01 22 at 23.27.30 How does Bitlocker Network Unlock work? Windows Server
sql server installation How to Install all Editions of Microsoft SQL Server 2025 Oracle/MSSQL/MySQL
article 1280x720.192a2586 1 How to remove an MDT Deployment Share Windows Server
Screenshot 2022 04 27 at 17.51.48 Remote Desktop Services Setup on Windows Server Windows Server

Comments (4) on “An error has occurred in the script on this page: HTA applications report a Script error after upgrading to ADK for Windows 11, version 22H2”

  1. Avatar photo Matthew Brock says:
    11/04/2023 at 8:34 PM

    my mdt image wizard comes back with this error after I follow these steps, mind you I did rebuild the mdt and made a new image.

    FAILURE (5616): 15299: Verify BCDBootEx
    Litetouch deployment failed, Return Code = -2147467259 0x80004005
    Failed to save environment to (80070057)
    Failed to run the action: Install Operating System.
    Unknown error (Error: 000015F0; Source: Unknown)
    The execution of the group (Install) has failed and the execution has been aborted. An action
    failed.
    Operation aborted (Error: 80004004; Source: Windows)
    Failed to run the last action: Install Operating System. Execution of task sequence failed.
    Unknown error (Error: 000015F0; Source: Unknown)
    Task Sequence Engine failed! Code: enExecutionFail
    Task sequence execution failed with error code 80004005
    RegQueryValueExW is unsuccessful for Software\Microsoft\SMS\Task Sequence,
    SMSTSEndProgram
    GetTsRegValue() is unsuccessful. 0x80070002.
    Error Task Sequence Manager failed to execute task sequence. Code 0x80004005

    Log in to Reply
    1. chris Christian says:
      12/04/2023 at 1:17 PM

      I can see a lot of task issues with your task sequence. Perhaps you need to see this guide: ADK|WinPE|MDT: Deploy Windows with WDS – TechDirectArchive

      I have a lot of troubleshooting guides on some of these error codes. Please use the search feature, thank you!

      Log in to Reply
  2. Avatar photo Dale H. says:
    18/10/2023 at 6:13 PM

    Hello, I followed the instructions to the letter however I am still getting the Host script error. My setup is a little different. I have a separate deployment share for the reference image capture (the ref image is a VM), then I create the reference image using litetouch.vbs capture script. I have a separate deployment share for creating our custom image by importing the reference image and then generating an ISO through Advanced Configuration>Media. It’s how I have been creating our images for years since we do not have the luxury of in house imaging. All of our PC’s are scattered all over the world.
    Error is as follows:
    Title: Windows Script Host
    Script: x:\deploy\script\litetouch.wsf
    Line:2
    char: 13
    Error: the value for the attribute is not valid: language
    Code: 80040049
    Source: Windows Script Host

    The device boots from ISO, loads my custom background image and then throws up the above error. I am assuming this is the same as what this article is referring to.

    Log in to Reply
    1. chris Christian says:
      18/10/2023 at 7:25 PM

      Hi Dale, due to the error message relates to the “language” attribute within the context of WDS as described above. Do you have the latest version of ADK installed? Does your deployment need it? If yes, please install it …

      • https://techdirectarchive.com/2022/09/29/how-to-correctly-upgrade-windows-assessment-and-deployment-kit-windows-preparation-environment-and-microsoft-deployment-toolkit/
      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • wacxx
    Install Windows Admin Center in an unattended mode using a self-signed certificate Windows
  • screenshot 2020 04 23 at 00.30.09
    How to mount a USB Drive in Linux Linux
  • Webp.net resizeimage 4
    Create, list, lock, deploy, and delete Azure Resource Group via Azure CLI AWS/Azure/OpenShift
  • Drop or delete a MySQL user from phpmyAdmin
    How to delete a MySQL User Account Oracle/MSSQL/MySQL
  • screenshot 2020 03 01 at 21.19.07
    Various ways to hide Windows Taskbar Windows
  • Docker error manifest
    Docker image OS “windows” cannot be used on this platform: No matching manifest for linux/amd64 in the manifest list entries from Microsoft Docker Registry Network | Monitoring
  • banner 3
    How to Enable or Disable SuperFetch in Windows 11 Windows
  • Encryption
    How to encrypt Microsoft SQL Server Traffic Oracle/MSSQL/MySQL

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,825 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.