Quantcast
Channel: Configuration Manager 2012 - Operating System Deployment forum
Viewing all articles
Browse latest Browse all 9126

Displaying an .HTA during the Windows Phase of a task Sequence. SCCM 2012 OSD

$
0
0

For the past day I've been trying to wrap my head around this thing with limited success. I am trying to display an .HTA within windows as the first step in a task sequence. The task sequence sets a variable "OSBUILD" and depending on what the variable is set to the task sequence rolls on down to the restart step at the end or lets the build occur. I'm successfully getting the .HTA to display within Windows PE and when the "allowosbuild" variable is set to no, it skips the relevant steps in the task sequence and rolls on down to the "restart computer" step, ( last step) and promptly throws a 4005 error with the smsts.log showing no errors and stating that it completed with no errors!(yes really!). Enough of the background, onto my task sequence! 

The "password in PE" step has a WMI query associated with it that only launches it within Win PE. The command line to launch my .HTA within windows is: cscript.exe "promptForPassword.vbs". This VBS script hides the task sequence bar and launches the .HTA within PE. The script is as follows:

set gWShell = WScript.CreateObject("Wscript.Shell")
Set gFso = CreateObject("Scripting.FileSystemObject")

locInstPath = gFso.GetParentFolderName(WScript.ScriptFullName) & "\"

'Hide SCCM Progress User Interface
Set ProgressUI = CreateObject("Microsoft.SMS.TsProgressUI")
ProgressUI.CloseProgressDialog
Set ProgressUI = Nothing

'Launch the PromptForPassword tool
call gWShell.Run("mshta.exe """ & locInstPath & "PromptForPassword.hta""", 1, True)

This is allowing the HTA to display, let the task sequence run if the correct password is entered or skips on down to the "restart computer" step if the incorrect password is used, throwing a 4005 error with NOTHING in the logs indicating a problem.

Now for the really frustrating part. Getting the .HTA to display within windows itself. I am following the guide posted here:

http://t3chn1ck.wordpress.com/2011/09/30/displaying-front-end-htas-within-an-sccm-task-sequence/

I have tried skipping using the serviceui.exe and used every combination of "mshta.exe PromptForPassword..hta" under the sun. It actually runs, you can see it in the task manager but it isn't visible on the screen for the user to interact with!

I included serviceui in my package and when running the command line "ServiceUI.exe -session:1 mshta.exe PromptForPassword..hta" within windows to get the .HTA to display it errors out saying I am using the wrong version of the program, ( even tho I have tried both the 32 bit and 64 bit versions). Using my .vbs script actually runs the .hta yet it is not visible on the screen but shows in the task manager as running! 

What is the correct method to get my .HTA to display within windows to the user? I appreciate the time and help!!


Viewing all articles
Browse latest Browse all 9126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>