2023-07-27

Migrate from HTA to SPA

Microsoft HTML Application (HTA) technology is based on Internet Explorer. And this is obsolete and will soon be removed. A HTA is running with mshta.exe, which is existing outside Internet Explorer and a default part of Windows 11. But as it is based on Internet Explorer we must face that HTA is going away too. A solid indicator is that the HTA documentation at Microsoft is no longer maintained and placed in a historical path.

HTA is a quick and neat way to build a nice and dynamic GUI for local tools. This has made HTA rather popular for many years, and there are a lot of solutions based on HTA. So migrating from HTA will be a significant task to many.

You can take the opportunity to migrate to a more complete technology stack like .Net with C#, but there will be a lot new tools to learn. Some might consider to go with PowerShell, but both WinForms and WPF are quite complex with PowerShell in comparison to dynamic HTML in HTA.

Single-Page Application

Another suggestion I have seen (link) as a replacement to HTA is Single-Page Application (SPA), where it is possible to use dynamc HTML and make the solution local on the client.

This works fine on very simple things. It is even possible to make a sensible filestructure for the SPA with external script and style files. But when you want to work with external resources like a database or the content of a file you hit rock buttom!

With HTA you can access external resources through ActiveX models or objects like ActiveX Data Objects (ADO) or FileSystemObject. And modern web browsers can't handle ActiveX. There is a Internet Explorer setting in Microsoft Edge, but that will most likely be removed.
I think that the real problem to Microsoft here is security, as ActiveX has given a lot of trouble on the internet. The COM technology that ActiveX is build on is still solid and widespread.

The conclusion must be that HTA can't be migrated to SPA as most HTAs are working on external resources like files or databases.
If I find a good replacement to HTA I will let you know.