Skip to content

Pass value with Button (vbscript)

Featured Replies

Hi All

 

I'm new into HTA/vbscript. I did created this HTA vbscript file. The only thing i'm trying to find out is how to pass the values from the textbox and dropdownlist with the button so that the TS can continue with deployment.

 

The HTA is asking for a computername and OU.

 

<html>
<head>
<title>Windows 8 - Bare-Metal deployment</title>
<HTA:APPLICATION 
     ID="objTest" 
     APPLICATIONNAME="Bare-Metal deployment"
     SCROLL="yes"
     SINGLEINSTANCE="yes"
>
</head>

<SCRIPT LANGUAGE="VBScript">

'Hide TS progress windows
Dim oTSProgressUI
Set oTSProgressUI = Wscript.CreateObject("Microsoft.SMS.TSProgressUI")
oTSProgressUI.CloseProgressDialog()

'Variablen
Dim sComputerName, oTaskSequenceA, oTaskSequenceB, sOuName

'SMS Objects
Set oTaskSequenceA = CreateObject ("Microsoft.SMS.TSEnvironment")
Set oTaskSequenceB = CreateObject ("Microsoft.SMS.TSEnvironment")

'Textbox computername
Sub CompNameTextbox
oTaskSequenceA("OSDComputername") = UCase(CompNameTextbox.Value)
End sub

'Dropdownlist OU
Sub OUselectSub
	If OptionChooser.Value = 1 Then
	oTaskSequenceB("OSDDomainOUName") = (LocationA)
	End If
	
	If OptionChooser.Value = 2 Then
	oTaskSequenceB("OSDDomainOUName") = (LocationB)
	End If
	
End Sub
		
</SCRIPT>
<body>
<input type="text" name="CompNameTextbox" size="30">

<select size="2" name="OptionChooser" onChange="OUselectSub">
    <option value="1">Location1</option>
    <option value="2">LocationB</option>
</select>

<input type="button" onclick="Deploy" value="Start deployment"


</body>

 

  • Author

Found the solution: Window.Close()

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.