sbond293
Posts: 108
Score: 2 Joined: 9/4/2006 Status: offline
|
In anticipation of being shot down in flames for considering using a VB6 front end (partly as I am having trouble executing it in WinPE) I have an HTA alternative I have also been working on. The basic script is as follows: FRONTEND.hta <job id="ZTIPromptForComputerName"> <script language="VBScript" src="ZTIUtility.vbs"/> <script language="VBScript"> Sub Window_Onload ForReading = 1 strNewFile = "computerOUs.txt" Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile _ (strNewFile, ForReading) Do Until objFile.AtEndOfStream strLine = objFile.ReadLine Set objOption = Document.createElement("OPTION") objOption.Text = strLine objOption.Value = strLine ComputerOU.Add(objOption) Loop objFile.Close End Sub Sub ShowOUPath oEnvironment.Item("OSDDomainOUName") = "OU=" & ComputerOU.Value & ",OU=XXX,DC=YYY,DC=ZZZ" oEnvironment.Item("OSDNEWMACHINENAME") = ComputerName.Value MsgBox "OU=" & ComputerOU.Value & ",OU=XXX,DC=YYY,DC=ZZZ" & vbCrLf &_ "Computer Name = " & ComputerName.Value End Sub </SCRIPT> <body> <select size="10" name="ComputerOU" style="width:300"></select><p> <input type="text" name="ComputerName" size="45"><p> <input id=runbutton type="button" value="Build Machine" onClick="ShowOUPath"> </body> </job> This seems to work fine as long as I miss out the line: <script language="VBScript" src="ZTIUtility.vbs"/> With the inclusion of ZTIUtility reference, the contents of the computerOUs.txt no longer seems to be iterated. Any idea why this might be? Thank you.
|