Jump to content


  • 0
Joriz

Pass value with Button (vbscript)

Question

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>

 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.