anyweb Posted February 15, 2011 Report post Posted February 15, 2011 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" 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. 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. Quote Share this post Link to post Share on other sites More sharing options...
dikkydik Posted February 22, 2011 Report post Posted February 22, 2011 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 Quote Share this post Link to post Share on other sites More sharing options...
wmmayms Posted February 22, 2011 Report post Posted February 22, 2011 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> Quote Share this post Link to post Share on other sites More sharing options...
anyweb Posted February 22, 2011 Report post Posted February 22, 2011 are you trying to launch the HTA in winPE or in Windows ? Quote Share this post Link to post Share on other sites More sharing options...
dikkydik Posted February 22, 2011 Report post Posted February 22, 2011 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... Quote Share this post Link to post Share on other sites More sharing options...
anyweb Posted February 22, 2011 Report post Posted February 22, 2011 where in the ts is it ? can we see a screenshot of the step in the ts Quote Share this post Link to post Share on other sites More sharing options...
dikkydik Posted February 22, 2011 Report post Posted February 22, 2011 Here it is: 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 Quote Share this post Link to post Share on other sites More sharing options...
anyweb Posted February 22, 2011 Report post Posted February 22, 2011 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 ? Quote Share this post Link to post Share on other sites More sharing options...
dikkydik Posted February 22, 2011 Report post Posted February 22, 2011 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... Quote Share this post Link to post Share on other sites More sharing options...
anyweb Posted February 22, 2011 Report post Posted February 22, 2011 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 Quote Share this post Link to post Share on other sites More sharing options...
dikkydik Posted February 22, 2011 Report post Posted February 22, 2011 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... Quote Share this post Link to post Share on other sites More sharing options...
anyweb Posted February 22, 2011 Report post Posted February 22, 2011 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 Quote Share this post Link to post Share on other sites More sharing options...
wmmayms Posted February 22, 2011 Report post Posted February 22, 2011 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 Quote Share this post Link to post Share on other sites More sharing options...
dikkydik Posted February 22, 2011 Report post Posted February 22, 2011 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 Quote Share this post Link to post Share on other sites More sharing options...
anyweb Posted February 22, 2011 Report post Posted February 22, 2011 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 Quote Share this post Link to post Share on other sites More sharing options...
dikkydik Posted February 22, 2011 Report post Posted February 22, 2011 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 Quote Share this post Link to post Share on other sites More sharing options...
dikkydik Posted February 23, 2011 Report post Posted February 23, 2011 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 Quote Share this post Link to post Share on other sites More sharing options...
technick Posted December 14, 2012 Report post Posted December 14, 2012 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 Quote Share this post Link to post Share on other sites More sharing options...
Peter33 Posted December 14, 2012 Report post Posted December 14, 2012 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. Quote Share this post Link to post Share on other sites More sharing options...
technick Posted January 31, 2013 Report post Posted January 31, 2013 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.? Quote Share this post Link to post Share on other sites More sharing options...
MgCherneski Posted February 6, 2013 Report post Posted February 6, 2013 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 Quote Share this post Link to post Share on other sites More sharing options...
Peter33 Posted February 6, 2013 Report post Posted February 6, 2013 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 Quote Share this post Link to post Share on other sites More sharing options...
Peter33 Posted February 8, 2013 Report post Posted February 8, 2013 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. Quote Share this post Link to post Share on other sites More sharing options...