You can also use the clipboard method to exchange with your PowerShell script data you want to display in your HTA. Running your updated HTA and PowerShell script code returns the following message box: While you can include the code into your HTML file, it is easier to keep the script code in a separate file and to include it by using the tag into a HTA: To add some activities your HTA, you need to write some VBA code. The first step to troubleshoot this issue is to open the Windows Task Manager and to close all running mshta instances. If you don't see your GUI, it is possible that you have a ' hanging' mshta process. When you start a HTA, you should see the HTA GUI. The process that runs your HTA file is called mshta.exe. You can customize the look and feel of your HTA by setting properties of your HTA object. The gist of a HTA is that you can run scripts that are included in HTML pages outside of the Internet Explorer's security model.
When you run this file, you will get a first impression for what HTAs are. You can use this code to develop your first HTA by copying it into a new file and saving it with a '.