Wednesday, January 07, 2009
Deployment Forum HomeDeployment Forum ArticlesDeployment Forum Download LibraryDeployment Forum Member BlogsDeployment Forum Community Forums
Member Login
StandardLiveID


Register
Forgot Password ?



Guests can view and read messages in the community forums, but you must register and log in to Deployment Forum before you can post messages. Click Register at the top of this page. Before posting messages, please read the forum guidelines at the bottom of this page.

Subject: starting hta
Prev Next
You are not authorized to post a reply.

AuthorMessages
bn2huntUser is Offline

Posts:94

Send Message
09/08/2008 10:15 AM  

I have created a small hta app to ask the user which OS they would like to install XP or Vista?  How do I get the HTA to launch.  I have pasted the code that I use to call the hta and the code of the Hta below.  I get the log entry and they it just hangs.  I can run the hta from the command line manually without errors.  Any ideas?  And how do I post code so it looks decent?

 

Thanks

Dan

Userexit.vbs

[code]

ologging.createentry "userexit - usergui hta called " & "mshta.exe " & oUtility.ScriptDir & "\usergui.hta " & Chr(34) & "#" & setmodelalias & Chr(34) , logtypeinfo

WS.run "mshta.exe " & oUtility.ScriptDir & "\usergui.hta " & Chr(34) & "#" & setmodelalias & Chr(34),0,True

If oEnvironment.Item("WizardComplete") <> "Y" Then

oLogging.CreateEntry "ERROR - The Deployment Wizard was cancelled or did not complete successfully - Notifying User (Error Number = " & Err.Number & ") (Error Description: " & Err.Description & ").", LogTypeError

MsgBox "The Deployment Wizard was cancelled or did not complete successfully. The deployment will not proceed."

Exit Function

End If

ologging.createentry "userexit - **** operating systsem is " & setmodelalias, logtypeinfo

 [\code]

Usergui.hta

[code]

 <HTML>

 

<HEAD>

 

<TITLE>HTA Application TemplateTITLE>

 

<HTA:APPLICATION

ID="usergui"

APPLICATIONNAME="usergui"

 

BORDER="thick"

 

BORDERSTYLE="complex"

 

CAPTION="yes"

 

CONTEXTMENU="no"

 

INNERBORDER="yes"

 

MAXIMIZEBUTTON="yes"

 

MINIMIZEBUTTON="yes"

 

NAVIGABLE="no"

 

SCROLL="no"

 

SHOWINTASKBAR="yes"

 

SINGLEINSTANCE="yes"

 

SYSMENU="yes"

 

VERSION="1.0"

 

WINDOWSTATE="maximized"/>

 

HEAD>

 

<script language="vbscript" type="text/vbscript" src="ZTIUtility.vbs">script>

<script language="vbscript" type="text/vbscript">

 

Dim model

Sub Window_Onload

ologging.createentry "userexit - usergui hta started" , logtypeinfo

self.resizeTo 300,200 'size of window in pixels width,height

 

self.moveto 10,10

getarg()

lit1.innerhtml= "Please Select the Operating system to install for your " & model

End Sub

 

Sub getarg()

MsgBox usergui.commandline

Dim args : args = Split(usergui.commandline,"#")

model = Left(args(1),Len(args(1))-1)

End Sub

 

Sub OK_button

oEnvironment.Item("WizardComplete") = "Y"

 

setmodelalias = document.os_form.os_select.value & setmodelalias

MsgBox document.os_form.os_select.value & vbcr & setmodelalias

ologging.createentry "userexit - usergui hta setmodelalias " & setmodelalias , logtypeinfo

window.Close

End Sub

 

SCRIPT>

 

<BODY>

 

<div ID=lit1>div>

 

<form name="OS_form">

 

<select name="OS_select" onchange =ok_button>

 

<option value="XP">XPoption>

 

<option value="Vista">Vistaoption>

 

select><br />

 

form>

<input id=runbutton class="button" type="button" value="OK" name="man" onClick="OK_button">

 

BODY>

HTML>

[\code] 

 

jbrixeyUser is Offline

Posts:18

Send Message
09/08/2008 11:35 AM  
You don't need to create an hta to do this. Just use a task sequence. Create a task sequence in the MDT workbench to install Windows XP and a second one to install Vista. Then once you have created the task sequences, when your technician (or yourself) launches the PE environment a script will automatically prompt you to choose a task sequence presenting the user with a choice of task sequences to run. If you are trying to change the look of the default hta that is launched by the MDT sequences, I would suggest getting the MDT Wizard Editor.
bn2huntUser is Offline

Posts:94

Send Message
09/08/2008 11:41 AM  
My only problem is that my superiors have told me to create a separate image for each model and OS. So if I do it the way you have explained it will show all of my task sequences, right? I didn't want that, I also have some future ideas on expanding on the hta and asking more questions with it but wanted to start small and get this working first.  I will look into the wizard editor, is that from MS?

Thanks

Dan
jbrixeyUser is Offline

Posts:18

Send Message
09/08/2008 12:17 PM  
Yes and no.

The better way to do it is to create a second deployment point. During the setup wizard for the new deployment point, choose the separate deployment share option and create a new deployment share on your MDT/WDS server. Once the new deployment point is created, open the properties of the share and you can choose what task sequences can be shown. You will need to make sure that you add the new boot image that gets created to your WDS servers boot images. Then what your techs will see during a PXE boot is 2 boot environments to choose from, your development/lab boot image and your deployment boot image. With the deployment boot image only the task sequences you configured to be advertised will be available for your techs to select, in your scenario Install XP or Install Vista (still two task sequences) but they are the only options available to choose from.

This is considered a best practice in any event so that you are not deploying images that are currently in development as you only advertise the task sequences that have finalized production OS images associated with them on your deployment point. The second deployment point also gives you the flexibility of choosing what applications are available for you technicians to choose from as well (nice for when you are still tweaking the unattended installation of an app).

You just have to ensure that you update both your deployment points when you make changes to drivers and applications so that your deployment point gets the updated content to be processed by the task sequence.
bn2huntUser is Offline

Posts:94

Send Message
09/09/2008 11:29 AM  
Ok, having the multiple deployment points makes sense and I can get that working. However I still have a need to run a custom HTA to pull some additional info and validate some other fields. Some of the techs aren't paying attention when they type in the computer name so I want to create an HTA that will ask for the computer name and validate it based on our naming conventions.

In the past we have just been assigning the apps in the database for each model of pc/laptop and doing a type/model deployment. We are getting more request to move to a role based deployment instead so I am going to try to ask for a role that they want to install on the pc/laptop from the same screen.

The HTA wasn't firing because the variable I was using was looking in the winpe boot image for he HTA. I have since modified the run command to call the HTA from the correct location and it is running. But I don't have access to varialbe that the userexit script uses, like oenvironment, and I haven't figured out how to pass the information from the HTA to the calling vbscript. Any ideas? Or is this scenario not practical to take on.

Thanks

Dan
You are not authorized to post a reply.



ActiveForums 3.7
Forum Policies
Minimize

These forums are a user-supported community for IT professionals to exchange deployment tips, solutions, and techniques. For the benefit of all Deployment Forum members, please observe the following guidelines when posting to these forums:

  • We reserve the right to remove any message. Our moderators will remove all messages that are not respectful or productive. Profanity, racism, prejudice, and flaming are not tolerated.
  • Do not advertise products or services. Our moderators will remove all advertisements or service announcements. Product and service recommendations from active Deployment Forum members are encouraged, however.
  • Make sure your question isn't already answered. Before posting questions, search the forums. After ensuring that your questions are unique, post them to the most appropriate forum. This will help reduce noise in the forums.
  • Help make the most of each thread. Do not post unrelated messages to a thread. Also, if you've resolved a question outside of these forums, please share the solution with other members by posting it back to the thread.
  • Do not share confidential information. Confidential information includes product keys and addresses. Our moderators will edit any message containing confidential information, so double-check messages and their attachments before posting them.
  • Post messages using only the English language. For the benefit of all Deployment Forum members, please post your messages using the English language.

We hope that you enjoy using this community. Please submit your comments and feedback on the Comments and Feedback page or post them to the Comments, Feedback forum.



Privacy Statement  |  Terms Of Use
© 2007 Jerry Honeycutt