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

does %SYSTEMDRIVE%\ = x: ? or c:\ have you checked ?

 

by attaching the hta to the toolkit package i know that my hta plus the scripts it has will always be available when i have the mdt scripts available (which is what the use toolkit package step does), it downloads the content (the files/scripts) and sets some variables (path etc)

 

I will do a webcast on this soon to clarify the steps involved

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...

 

Dont think the toolkit package will make any diffrence in this case (It is basically a collection of script to make it easier to automate some tasks during OSD).

 

I think however that specifying the full path to your HTA might make a difference.

I think your smsts.log should give more information regarding this. Try opening this in notepad while in F8 mode. It should be located here: %temp%\smsts\smsts.log

Share this post


Link to post
Share on other sites

  • 0

Did not check, but presume it will give X: back.

Tomorrow I will try to extend the commandline to:

 

%SYSTEMDRIVE%\windows\system32\mshta %SYSTEMDRIVE%\scripts\TASK24.hta

 

and see what happens.

 

And that toolkit package... Think I have to agree with wmmayms.

The tools (mshta.exe) and scripts (task24.hta) are already present (included in the WIM).

 

So that's why I am wondering about the why (you included it in the TS).

 

 

I also looked more then once in the smsts.log.

But learned nothing sofar regarding the problem.

Will take several new looks again hoping to get a clue

Share this post


Link to post
Share on other sites

  • 0

i include it because my hta has scripts that depend on some of the other scripts within the scripts sub directory of the toolkit package, and because it's an easy way of doing it :)

Share this post


Link to post
Share on other sites

  • 0

Morning all,

 

Update: the commandline %SYSTEMDRIVE%\windows\system32\mshta %SYSTEMDRIVE%\scripts\TASK24.hta

Results in a HTA being displayed.

 

So indeed, the problem was that the HTA could not be found.

 

Thanks for all your help.

 

I'm moving forward to read the variables set and execute steps (or not), depending on their value.

 

Dikky Dik

Share this post


Link to post
Share on other sites

  • 0

How does one go about allowing the HTA to prompt when running a TS from within Windows?

Here is how my TS is configured currently, and when it gets to the "Display HTA" step, it just gets stuck, I'm assuming waiting for user input, but the window does not appear.

 

Thanks

post-18525-0-46204500-1355514732_thumb.png

Share this post


Link to post
Share on other sites

  • 0

Hi Tech,

 

since you are using MDT already put your HTA in the script folder of it. Also after the "use toolkit package" run a gather step (for later use to collect the local data; make your TS dynamic).

Then call your HTA with %ToolRoot%\ServiceUI.exe -process:tsprogressui.exe %SYSTEMROOT%\system32\mshta.exe %SCRIPTROOT%\my.hta

This will also hide the task sequnce progress as long as the HTA runs.

Share this post


Link to post
Share on other sites

  • 0

Thanks Peter,

That worked! However, it seems like since we upgraded to SP1, whenever we try to run that TS (which was working) through Software Center, it just sits there. SC says it is downloading, and at about 10% it says installing, but never gets anywhere. Like I said, it was working, and we haven't changed anything, just updated to SP1.


Any insight.?

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.