Coretech HTA

The main idea with this HTA is to assist small and medium sized organizations with an easy way to implement a custom OSD solution without having any developer or HTML skills. The HTA solutions can be used when booting directly into WinPE and to prestage computers.

Why; You might ask, Why, do Coretech create this tool instead of using the built-in tools in Configuration Manager or using the UDI wizard in Microsoft Deployment Toolkit?  The answer is straight forward. We often run into customers who do not have the knowledge it takes to build custom solutions or use the UDI designer. Our Coretech HTA is intended to those administrators where OSD only plays a small part in their working life but never the less must have custom solution that works right out of the box.

– And hey Coretech dudes; why don’t you just use the MDT database and all the MDT features? Why do you spend time creating solutions that already exist “out there”? Well, because we are talking with multiple customers that are not OSD experts and just want to have a simple solution.

The main benefits of using the Coretech HTA is:

  • Very easy to implement
  • No developing skills are required to install or maintain the solution
  • Automate the computer naming standard
  • Easily create OSD “roles” and target specific applications/packages to each role.
  • Create custom selections like integrating USMT, Bitlocker etc.
  • Control language and time zones.
  • Configure primary user.

We control and configure most settings using variables on computer objects and collections. This method might be new to you, and will certainly require a new way of thinking.

Download HTA and Task Sequence

System requirements

The following requirements must be met before installing the HTA:

  • A domain user account, the account will be granted permissions in Configuration Manager to create and delete computer objects. The user account do not require any additional permissions. The account used in this guide is named viamonstra\cm_hta.
  • System Center 2012 Configuration Manager SP1 or later. For those who are running ConfigMgr 2012 R2, you also required to install KB2905002 and KB2907591
  • Microsoft Deployment Toolkit integration and a MDT toolkit package.
  • A share than can host the HTA files. In this blog post \\cm01\sccm_sources$\OSD will be used.

What the HTA is not

The HTA is not an Enterprise solution or a replacement for MDT.

Install the HTA

  1. Ensure you have a HTA user account created in Active Directory as mentioned in the system requirements.
  2. Run the hta_installer.exe as administrator and fill Install Folder, HTA user and Password.


  3. When ready click Install close the window when the installation is done.

What happens during the installation?

  1. A new user role is created and associated with the HTA user account.



  2. A new boot image is added.


  3. A new folder called OSD is added along with several OSD collections.


  4. A Task sequence is part of the download and can be imported. The task sequence includes examples on how you can use the collection variables in the deployment.


  5. During the install process, the files used to support the HTA solution is copied to the share specified in the installer. In my example the share is


    Files in the main folder:

    HTA.exe is the main executable.

    StartHTA.vbs used to the HTA in “prestage mode”.

    Files in the Bootimage folder:

    The custom boot image


    Files in the Bootimage\Prestart folder:

    RunHTA.exe maps the drive letter T to the HTA file share, and executes the RunHTA.vbs

    RunHTA.vbs executes the HTA.exe main executable and waits for it to end.


    Files in the Config folder:

    Config.xml, the main configuration file containing information about the site server and the main OSD folder.

    Logo.png, the top logo used in the HTA.

    PCNumber.txt keeps track of the running number. The file is used if a running number is being used as part of the computer name.

    RunAfter.bat contains commands executed after the HTA.

    RunBefore.bat contains commands executed before the HTA.


How to get started with the Coretech HTA solution

You are almost ready to use the solution as soon as the install is finished. Only a few details needs to be configured before you can deploy the very first image in your environment.

Modify the custom boot image

  1. From the Software Library, select Operating Systems, Boot Images.
  2. Open the HTA Boot Image (x86) boot image properties, select the Optional Components tab.
  3. Select Optional Components, click the Yellow icon and add HTML (WinPE-HTA) and Database (WinPE-MDAC) support.



  4. Click OK and update the boot image.
  5. Distribute the boot image to your distribution points and PXE enabled distribution points.


Deploy the task sequence

In theory the HTA is now ready for use (although you might want to customize the task sequence first).

  1. In order to use the task sequence you need to create a deployment to the Unknown computers collection and each of the collections that can contain a machine object. In the example below three available deployments are created allowing me to deploy a custom Windows 8.1 or Windows 7 image to the Developers collection.


  2. WinPE will launch and show the HTA, in this example I’ll create a new Windows 8.1 computer in the developer collection. To do so, click Windows 8 and Developer. Specify a computer name (this can be 100% automated using the collection variables) and the primary user of the device.


  3. Click Additional selections and select a language from the dropdown box (you can add multiple languages in the OSD collection hierarchy).
  4. Click Install to begin the image process. What happens now is that the HTA will look for an existing object in ConfigMgr, delete the object and create a new computer object in the Windows 8 Developer Collection.


  5. If you open the computer properties in the ConfigMgr console you’ll notice several computer variables


  6. If you open the OSD Windows 8 developer collection and select the Variables tab, you’ll find additional variables. Those are not effective by default, but can be used in the task sequence to control department specific applications and other cool stuff.


  7. To deploy specific applications to the developers, open the Task Sequence and navigate to the Software –Developer step.
  8. From Add, select General, Install Application and specify the applications.


  9. Select the Options tab, and click Add Condition, Task Sequence Variable.


  10. In variable type HTA_Type and in value type Developer. This will ensure that only computers in a collection with the Developer variable (both Windows 7 and Windows 8.1) will run the step.


  11. Click OK and close the task sequence.

Modify the default values in the HTA

The true value of the HTA is found in the simplicity when it comes to making changes. Changes like controlling the computer names, modifying the default values etc. All you need to know is the variable and the optional values. Below is the list of some of the values you can modify in the hta_main collection, after that are some examples that you might find useful.










TRUE will delete all Computer Objects in Configuration Manager with the same BIOS GUID or MAC Address as the Computer being processed.





TRUE, will update the All Systems collection.




Defines the Chassis value used as part of the ComputerName Structure if the Computer is a Desktop.




Defines the Chassis value used as part of the ComputerName Structure if the Computer is a Laptop.




Defines the Chassis value used as part of the ComputerName Structure if the Computer is a Virtual machine.




Defines the Chassis value used as part of the ComputerName Structure if the Computer is a Tablet.





TRUE the Number Value will be incremented, when Number is used as part of the ComputerName Structure.





TRUE the Text field in the ComputerName Structure will be used instead of the default Number field.




Defines the character length of the Number. Mandatory if ComputerName_Number_UseText is configured to True.




Defines the value used if Static is used as part of the ComputerName Structure.


String Array


Defines the ComputerName Structure, each field with its length, separated with semicolon.

C = Chassis

D = Dropdown

N = Number

R = Role

S = Static

T = Text

U= User Name



Defines the value used as the start value for the Primary User UserName field.





If set to Button, the Mandatory Selection section of the HTA, will be shown as Buttons.

If set to Dropdown, the Mandatory Selection section of the HTA, will be shown as Dropdown boxes.








Defines the number of columns the Buttons in the Mandatory Selection section of the HTA, is shown in.

Needs to be defined when HTA_Select_Type is set to Button



Select Role

Defines the Text to use as the header for Role Selection in the Mandatory Selection section.



Select Type

Defines the Text to use as the header for Role Type Selection in the Mandatory Selection section.



Specify Computer Name

Defines the Text to use as the header for ComputerName specification in the Mandatory Selection section.


String Array


Defines the Text to use as the headers for each part of the ComputerName structure in the Mandatory Selection section, separated with semicolon.

Needs to have the same number of parts as the ComputerName_Structure



Specify Primary User

Defines the Text to use as the header for Primary User specification in the Mandatory Selection section.




Defines the Text to use as the header for Primary User UserName specification in the Mandatory Selection section.




Defines the text to remove from Collection Names, when showing them in the HTA.




Defines the Root Role FolderId of the HTA Configuration




Defines the default Role choice for the HTA Configuration.




Defines the Root Selection FolderId of the HTA Configuration




Defines the Variable Name of the ComputerName Value




Defines the Variable Name of the PrestagedBy Value




Defines the Variable Name of the AssignUsersMode Value




Defines the Variable Name of the UdaUsers Value


Modify the HTA

The HTA is controlled by folders and collections. If you look at the main HTA you’ll notice two main buttons (Windows 7 and Windows 8), those correspond to the folders created in the Roles folder. By creating a new folder in Roles, you’ll automatically create a new main button in the image.



Once the role is selected, one or more role types are available. Those are controlled by the collections you have created in the role folder. In this example I have created 3 different Server 2012 R2 role types.



Prestaging computers

You can prestage computers by running the hta.vbs directly from the server. The only difference is that you will be prompted for a user name, password and a MAC address. Once you have entered those information you’ll be presented with the HTA from where you can configure the computer information.





What’s next

This blog post is meant to be an introduction that will give you enough information to get started with using the tool. The solution also contains other features, so stay tuned more information will follow.

This tool would never have existed if it wasn’t for my fantastic team of dedicated collegues, huge colleagues goes to both Jakob Svendsen (contributing developer) and Claus Codam (main developer).

Comments (27):

  1. Thomas Alterhaug says:

    Great work! Just wanted to inform you that the installer creates 2 x86 boot images, but no x64.


  2. John Garfield says:

    Is it possible to remove the usmt and Language selections? Or remove the entire additional selections option ?

  3. Niklas says:

    Thank you for this good information and for the hta
    Please can you explain how to display the hta during task sequence?

    It did not start automatically as describe

    • Klim says:

      kent, hi!

      Experiencing the same problem.
      No understanding of how to set up a task sequence.
      Do as mandatory or not?
      Use the task “all collection” or only on OSD windows xxx

  4. tutti & co says:

    tutti & co

    Coretech Blog » Blog Archive » Coretech HTA

  5. […] have read here, here, here, here and here for HTA .I used HTA available here and modified and used in my task […]

  6. […] have read here, here, here, here and here for HTA .I used HTA available here and modified and used in my task […]

  7. […] have read here, here, here, here and here for HTA .I used HTA available here and modified and used in my task […]

    • Euan says:


      I’m having issues installing the HTA exe, my SCCM installation is on the D drive and it fails at creating boot. I tried copying the boot.wim to the location in the log file but still fails. Is it possible to get a copy of the source code or is there a workaround?



  8. Kent Agerlund kent says:

    There is no issue having ConfigMgr installed on the d: drive. I do that all the time. Have you deleted the OSD collections before running the install again? And do you have the correct hta account?

    • Euan says:

      Doesn’t look like it gets far enough to add the OSD collections.

      Could not copy Boot Image from: “C:\Program Files\Microsoft Configuration Manager\\OSD\boot\i386\boot.wim” to: “\\servername\SCCM_Sources$\OSD\HTA\BootImage\boot.wim”. Warning: Could not find a part of the path ‘C:\Program Files\Microsoft Configuration Manager\\OSD\boot\i386\boot.wim’.

  9. Dale says:

    When trying to import the task sequence I get an error “cannot validate a dependency to Package PS100002”. I know I don’t have that package in SCCM but how can I import it anyway and then change the reference to the package later?

  10. Kent Agerlund kent says:

    It’s the boot image, the image file and the mdt packages. Just replace the steps in the task sequence with own packages.

  11. […] have read here, here, here, here and here for HTA .I used HTA available here and modified and used in my task […]

  12. […] have read here, here, here, here and here for HTA .I used HTA available here and modified and used in my task […]

  13. Tyler says:

    I consistently get an error, “It doesn’t seem that you have a working connection to the central site server.” I have enabled command line support on the boot image and I am able to use the NET USE command to map the HTA path. I am lead to believe that there might be an issue with my config. Please assist me, thanks in advance.

    • Tyler says:

      The SA account that was created required permissions to the share even though I had set another SA account to be the “Network Access Account”

  14. Anderz says:

    I wonder the following,

    1. Depending on the role one choose, could one get a computername prefix depending on this? If I choose Windows 7 I would get a specific prefix that I have created, the ability to connect the role with a prefix.
    2. Is there a way to use the computers serialnumber as the computername, either with or without a prefix.
    3. Is there a way to to arrange the sort order of the roles without changing the folder names?
    4. I see that you have a OSD_Roles_Default would it be possible to also set a OSD_Selections_Default?



    • Anderz says:

      I forgot 2 more questions…

      5. Is there a way to also set the “Select Role Tpe” with a default value, OSD_Roles_Type_Default?
      6. Is it possible to run this HTA with a 64-bits WinPE?



    • Dan says:

      Yes, you can set the following in hta_main


      then make sure the following exists in the naming scheme.
      ;T7 or any number u need.

  15. Kev S says:

    Getting “ERROR: Creating HTA User” during the installer.

    Any ideas as to what is causing this and can this be fixed post-install as it seems to have installed most requirements correctly.


  16. Greg F says:

    Getting the same error as Kev S. Above I was wondering if any one knows how to address it.

    Start: Creating HTA User. BackgroundWorker 5/12/2015 3:53:11 PM 1 (0x0001)
    Could not add HTA User. Error: Generic failure CreateHTAUser 5/12/2015 3:53:11 PM 1 (0x0001)
    Failed: Creating HTA User. BackgroundWorker 5/12/2015 3:53:11 PM 1 (0x0001)
    Installation Failed. Error: Creating HTA User Installer 5/12/2015 3:53:11 PM 1 (0x0001)

  17. Dale says:

    I have it all setup now but one thing is confusing: Should I still get the task sequence wizard displaying all the deployed TS’s? Isn’t that controlled using the HTA when I select the “Windows 7” and “Developer” buttons?

  18. Thor says:

    Thanks for the HTA.
    What steps do we need to perform to get this to run on x64 boot immage? we are getting an error “the subsystem needed to support the image type is not present”

  19. Michael says:


    Is it possible to show roles based on computer model?


  20. Bo says:

    Is this solution open source?

Leave a Reply