Jump to content


  • 0
anyweb

How can I display my HTA

Question

To add your HTA to your task sequence, you'll first need a boot image with HTA support. Once you have that the rest is easy.

 

At the beginning of your task sequence create a Run command Line step with the following in it

 

mshta.exe "%scriptroot%\wnb\Deploymenu.hta"

 

display the hta.jpg

 

let me explain what is happening in this step...

 

 

The mshta.exe file is like a web browser and displays our HTA (hypertext application).

you'll notice i'm using a path to our HTA which is "%scriptroot%\wnb\Deploymenu.hta" that is because I place the HTA files in a sub directory of my MDT toolkit scripts directory (MDT Toolkit scripts directory=%scriptroot%).

 

This is not possible without a Use Toolkit Package step shortly before this step otherwise the %scriptroot% variable won't be set, so prior to this in my Task Sequence I have a Use Toolkit Package step.

 

use tooolkit package.jpg

 

To copy your HTA file(s) to a sub directory in your MDT Toolkit package, locate the package source in ConfigMgr, find the scripts directory and create a new sub directory called My_Custom_Scripts (or whatever you want) which contains your scripts. In my example the sub directory is called wnb and I place my HTA file and all supporting scripts in there. Don't forget to Update your distribution points for your MDT Toolkit package after copying the new scripts/files.

 

scripts.jpg

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

Hi,

 

I created a Boot image with HTA support, and imported it into SCCM without a problem.

I am able to boot from it via PXE and so far so good.

 

If I add the taks to display a HTA (where the user is presented a few options like format C: only or repartition the entire disk), the HTA does run but is not visible to the user behind the keyboard.

Pressing F8 and starting taksmgr via the command prompt shows me that mshta.exe is running.

 

when starting the command used in the TS in the command prompt, the HTA gets shown as wanted and expected.

 

Any suggestions?

 

Regards, Dikkydik

Share this post


Link to post
Share on other sites

  • 0

Hi,

 

I created a Boot image with HTA support, and imported it into SCCM without a problem.

I am able to boot from it via PXE and so far so good.

 

If I add the taks to display a HTA (where the user is presented a few options like format C: only or repartition the entire disk), the HTA does run but is not visible to the user behind the keyboard.

Pressing F8 and starting taksmgr via the command prompt shows me that mshta.exe is running.

 

when starting the command used in the TS in the command prompt, the HTA gets shown as wanted and expected.

 

Any suggestions?

 

Regards, Dikkydik

 

 

maybe launching it this way:

cmd /k mshta.exe <HTA>

 

 

 

Share this post


Link to post
Share on other sites

  • 0

have you copied the hta file itself into that path ? via the extrafiles method ? otherwise how can mshta.exe find the file ? sounds to me like mshta.exe is indeed running, but displaying nothing as it doesnt know where the hta file is

 

you see, i refer to my hta file by adding it in the Use Toolkit package step

Share this post


Link to post
Share on other sites

  • 0

I copied the HTA to a folder in the root of the WINPE wim file.

That is why I called it directly with the command line.

 

I saw the toolkit package step in your tutorial, but have no clue what it does.

So could you fill me in, who knows it makes me see why, what etc and make it work...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.