Jump to content




anyweb

How can I display my HTA



Recommended Posts

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


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

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

are you trying to launch the HTA in winPE or in Windows ?

Share this post


Link to post
Share on other sites

It is in the PE phase.

Questions presented are:

 

Formatting C: drive only or repartition whole disk

Language of windows version to be installed

 

In other words:

All choices to be made before the Windows phase...

Share this post


Link to post
Share on other sites

where in the ts is it ? can we see a screenshot of the step in the ts

Share this post


Link to post
Share on other sites

Here it is:

 

post-8841-0-38223300-1298396166_thumb.jpg

 

The HTA sets environment variables.

Depending on the value, Format and partition disk will get executed (or not)

and the English or Dutch Windows will be installed

Share this post


Link to post
Share on other sites

and what's in your Start HTA step ? i see you are not using the mdt toolkit so how are you specifying the path to the actual hta file ?

Share this post


Link to post
Share on other sites

The commandline I use is:

 

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

 

The result is that you see nothing.

But when pressing F8 and start taskmgr, you see that the mshta process (application) is running...

Share this post


Link to post
Share on other sites

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

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

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

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

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

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

In your case it makes sense and is the logical thing to do.

In my case it could be an option, but this is just as easy (all is included in the WIM).

 

Will post updates tomorrow.

Thanks so far all

Share this post


Link to post
Share on other sites

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

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

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

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

I'm having the same issue as Technick. I've followed all the above suggestions and the HTAs will display in PE but they just hang in Software Center.

 

Any help is appreciated.

 

-Mike

Share this post


Link to post
Share on other sites

I have not tried it yet from the Software Center after upgrading to SP1. But i'll check this out and report back.

 

Just by the way. You still need this snippet (down there) of script in your HTA. The command i posted just will make sure that the HTA runs in the same context as the progress bar.

 

Set TSProgressUI = CreateObject("Microsoft.SMS.TsProgressUI")
TSProgressUI.CloseProgressDialog

Share this post


Link to post
Share on other sites

OK, i have just checked it out and it runs without any problems. Actually the performance has improved by miles compared to RTM.

 

If you run it from the software center, make sure that the HTA is not hidden behind the other windows. So rather set the property to show in the task bar, or use some script to bring it to front.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×