Jump to content




Karthik2811

HTA does not appear during the OSD



Recommended Posts

Hi Guys,

 

My environment is not integrated with MDT,I created a HTA file where tech can select the list of OU's(I have more than 100 OU's) during the OSD, I have added the hta file to run after the Disk partitioned .

 

While testing i am not able to see the Front end ,i can see the log files(attached)

 

Please let me know if any thing need to be setup in additional.Also help me in adding Computer description in the same hta file.

 

 

 

smsts.log

post-34027-0-91773300-1473167635.jpg

Share this post


Link to post
Share on other sites


Have you created a package with no program for your HTA and are referencing that in your 'Run Command Line' step?

 

Have you added HTA support into your boot image?

 

I remember having issues with loading a HTA years ago when 2012 first came out where I had to copy the file locally first and then reference that full path.

Share this post


Link to post
Share on other sites

Hi Tregelen,

 

Yes ,i have created a package with no program and referenced in the Run Command Line step.

Yes ,i have added HTA support into my boot image.

 

Here is the script,

 

==================================================================================================

 

<script type="text/vbscript">
Option Explicit
On Error Resume Next

'Declare Variables
Dim objWMI, shell, objChassis, objSerial,sComputerType,sSerial,sComputerName, objInstance, TSEnvironment,env
Set objWMI = GetObject("WinMgmts:")
set shell = CreateObject("wscript.shell")

' Identify Chassis Type
Set objChassis = objWMI.InstancesOf("Win32_SystemEnclosure")
For Each objInstance In objChassis
Select Case objInstance.ChassisTypes(0)
Case "8", "9", "10", "12", "14", "18", "21"
sComputerType = "L"
Case "3", "4", "5", "6", "7", "15"
sComputerType = "D"
Case "23"
sComputerType = "D"
Case "1", "2"
sComputerType = "V"
Case Else
sComputerType = "D"
End Select
Next

'Gather Serial Number
Set objSerial = objWMI.InstancesOf("Win32_BIOS")
For Each objInstance In objSerial
sSerial = objInstance.SerialNumber
Next

'Build the OSDComputerName string
sComputerName = "W7" & sComputerType & sSerial

' Declare SCCM Task Sequence Variables and Then Set The Values
Set TSEnvironment = CreateObject("Microsoft.SMS.TSEnvironment")
TSEnvironment("OSDComputerName") = sComputerName
TSEnvironment("Type") = sComputerType

'To test the OSDComputerName value remove the ' from the line below.
'Wscript.Echo sComputerName

'******************************************************************************'
' Size & Positioning '
'******************************************************************************'
winWidth=300
winHeight=400
window.resizeto winWidth,winHeight
centerX=(screen.width-winWidth)/2
centerY=(screen.height-winHeight)/2
window.moveto centerX,centerY
posX=0
posY=0
move=0


'******************************************************************************'
' Function to Close HTA '
'******************************************************************************'
Function closeHTA()
self.close
End Function

'******************************************************************************'
' Validate Variables '
'******************************************************************************'
Sub runValidation
If ComputerName.value = "" Then
msgbox("Please Enter a Computer Name")
ElseIf Username.value = "" Then
msgbox("Please Enter a Username")
ElseIf EmployeeID.value = "" Then
msgbox("Please Enter a EmployeeID")
Else
runInstall
End If
End Sub

'******************************************************************************'
' Configure Task Sequence Variables '
'******************************************************************************'
Sub runInstall
'msgbox("Test: " & varPanel)'

'************************************************************'
' Computer Name '
'************************************************************'
TSEnvironment("OSDComputerName") = sComputerName
'msgbox("ComputerName TSValue: " & TSEnvironment("OSDCOMPUTERNAME"))'

'************************************************************'
' AD OU '
'************************************************************'
If ADOU.value = "1" Then
TSEnvironment("swn_ADOU") = "(ABU)"
'msgbox("AD OU TSValue: " & TSEnvironment("swn_ADOU"))'
ElseIf ADOU.value = "2" Then
TSEnvironment("swn_ADOU") = "(DBI)"
'msgbox("AD OU TSValue: " & TSEnvironment("swn_ADOU"))'
ElseIf ADOU.value = "3" Then
TSEnvironment("swn_ADOU") = "(JEB)"
'msgbox("AD OU TSValue: " & TSEnvironment("swn_ADOU"))'
End If
'************************************************************'
' Set Primary User '
'************************************************************'
TSEnvironment("SMSTSUdaUsers") = Username.value
'************************************************************'
' Employee ID '
'************************************************************'
TSEnvironment("SMSTSUdaUsers") = EmployeeID.value
'************************************************************'

closeHTA()
End Sub

 

========================================================================

Share this post


Link to post
Share on other sites

Try copying the file locally first and then reference the full path in the command line. You can use the step 'Download Package Content' to copy the files and assign that path to a variable and then reference that in the 'Run Command Line' step.

  • Like 1

Share this post


Link to post
Share on other sites

It worked ,Thanks. HTA is now displaying now during the OSD.

 

How do we hide the Task Sequence until we complete the HTA?

 

I have error in the script .Can anyone assist please ?

Share this post


Link to post
Share on other sites

There is a handy post regarding hiding the TS on this forum, located here

 

As for the error, what messages are you getting?

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


×