HTA script help - define options and specify variables

Hi. I am trying to modify a script I copied from someone on the technet forums that basically lets you name a computer before sysprep is started and joined to the domain automatically. i don't know anything about scripting and i am having trouble finding someone that knows how to code HTA files.. could you please help me take a look?

the code is here: (so i don't flood the forum)  http://pastebin.com/Fjh8UurG

what i want to do is the following: i want to have a box named "network" .. this network box has three options 

1) local

2) staff

3) student.

choosing any of those "networks" i would statically assign the values for :

  1.    domainName = DomainNameArea.Value
  2.    userName = UserNameArea.Value
  3.    domainAdminPass = PasswordArea.Value
  4.    domainAdminPassConfirm = PasswordAreaConfirm.Value
  5.    OUName = OUNameArea.Value

i wonder if a line like this would work :

<tr>
<td>Network:</td>

<td><input type="text"  size="30">
<select size="1" >
    <option value= name="OUNameArea" value="OU=someou,DC=domain,DC=local" name="UserNameArea" value="DCJoin" name="PasswordArea" value="password"">student</option>
    <option value= name="OUNameArea" value="someotherou,DC=domain,DC=local" name="UserNameArea" value="DCJoin" name="PasswordArea" value="password"">>staff</option>
</select>
</td>
</tr>

thanks,

October 24th, 2013 1:33am

Start here: http://www.w3schools.com/html/default.asp

And here: http://technet.microsoft.com/en-us/bb291022.aspx

Free Windows Admin Tool Kit Click here and download it now
October 24th, 2013 1:51am

Here's another good HTA resource:

http://technet.microsoft.com/en-us/scriptcenter/dd742317

October 24th, 2013 9:50am

Here is a bootstrap.  I know this stuff is very scary.  It takes a bit of getting used to .

<select id="list" onchange='msgbox(Me.options(Me.SelectedIndex).Value)'>
     <option value="value 1">Option 1</option>
     <option value="value 2">Option 2</option>
     <option value="value 3">Option 3</option>
     <option value="value 4">Option 4</option>
 </select>

Tis displays the value of the selected option.

This will only work in an HTA.  In HTML you will need to set the page for VBS

Free Windows Admin Tool Kit Click here and download it now
October 24th, 2013 10:56am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics