Create HTA for WinPE to Set Keyboard Layout and Protect Task Sequence with a Password

Imagine the following scenario: You need to deploy a sequence for many languages and you need to protect it with a password into WinPE. How to do it?

At first, and for sure, there’s nothing developed by Microsoft which can help you at this point.

If you need something similar, the following lines must be gold for you, for sure 🙂

First Part:

Create an HTA which allow to set many languages on WinPE (Through a Drop Down List)

 hta-languagesettings

Second Part:

Protect the Task sequence with a Password that will be inserted in a keyboard format selected before!

 hta-passwordprotection

But, how to do it? Quite simple.

Our sequence just need to have three steps in the first group to do it, as the image below shows:

The first step must define the password for sequence (through the “Set Task Sequence Variable”)

 ts-settwoHTAs-forKeyboardLayout

The next ones run two packages with two HTA’s with abilities to be executed on WinPE

  • Ask user to select a WinPE keyboard language:

Basically, and in a very quickest way to describe it, the HTA uses the “wpeutil” library to set the “keyboardlayout” property for a specific language, as the following image shows:

 partofscript-setKeyboardLayout

In this specific demonstration, i selected the French language layout, but you can selected one of those in this extended list provided by Microsoft: http://msdn.microsoft.com/en-us/library/ms912047%28v=winembedded.10%29.aspx

Note: The design of HTA and the main credits of it must be given to Johan Arwidmark e his fantastic post on codeplex! http://prettygoodfrontend.codeplex.com/

  • Ask user to insert a password for Deployment!

You don’t need to invent nothing for that. I used the fantastic post on the following link and just adapted to use a variable given by task sequence otherwise to use it directly on package (less secure in my opinion)

http://managedux.com/2011/06/20/adding-a-password-to-a-single-pxe-boot-task-sequence/

 script-tsProtection

Enjoy your deployments

/ Fabio

Leave a comment