Support is >Here<

MDT Imaging Support Expert Advice

RSS
Facebook
Twitter

Look who's giving Logan the cuddles.

Using the Wizard Editor is fairly self explanatory for adding simple wizard panes. In 90%+ deployment scenarios, a simple wizard pane including a couple of radio buttons suffice.

Here is a simple “Department Name” Wizard Pane, which include 2 radio buttons; “IT Department” and “Sales”. After the Wizard is answered, a “DepartmentName” variable is created and populated with either “ITDEPT” or “SALES” based on the wizard selection:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<H1>Choose the User Department.</H1>
<table>
 <tr>
   <td><input type=radio name="DepartmentName"
   id="DTRadio1" checked value="SALES" accesskey=s language=vbscript />
   <label class=Larger for=DTRadio1 language=vbscript >
   <u class=larger>S</u>ales Department.</label></td>
 </tr>
 <tr></tr>
 <tr>
   <td><input type=radio name="DepartmentName"
   id="DTRadio2" value="ITDEPT" accesskey=u language=vbscript />
   <label class=Larger for=DTRadio2 language=vbscript >
   <u class=larger>I</u>T Department.</label></td>
 </tr>
</table>

Department Name Wizard

Now lets create a more advanced prompt for that 10% of times when radios are not enough. This prompt will ask for a string named “NewUserName”. It will verify that the string entered is 10 characters in length and only contains letters.

1
2
3
4
5
6
7
8
9
10
11
12
<H1>Please enter the System's New UserName.</H1>
 <span style="width: 95%;">
 <span class="Larger"><u class=larger>U</u>ser Name:</span>
   <input type=text id="NewUserName" name=NewUserName maxlength=10
   size=10 language=vbscript onpropertychange=ValidateNewUserName
   AccessKey=U />
   <p>&nbsp;
     <label class=ErrMsg for=NewUserName>Answer is Required..</label>
     <label class=ErrMsg id=InvalidChar>Letters only!</label>
     <label class=ErrMsg id=TooShort>Answer must be 10 characters!</label>
   </p>
 </span>

Now you must add Functions to the “\Scripts\DeployWiz_Validation.vbs” script to support the Function call (ValidateNewUserName) which performs the string validation.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'''''''''''''''''''''''''''''''''''''
'  Validate NewUserName
'

Function ValidateNewUserName
 
	' Check Warnings
	ParseAllWarningLabels
 
	If Len( NewUserName.value ) < 10 then
		InvalidChar.style.display = "none"
		TooShort.style.display = "inline"
		ValidateNewUserName = false
		ButtonNext.disabled = true
	ElseIf IsValidNewUserName ( NewUserName.Value ) then
		ValidateNewUserName = true
		InvalidChar.style.display = "none"
		TooShort.style.display = "none"
	Else
		InvalidChar.style.display = "inline"
		TooShort.style.display = "none"
		ValidateNewUserName = false
		ButtonNext.disabled = true
	End if
 
End function
 
Function IsValidNewUserName( NewUserName )
 
	const IVNAME_TEST = "[a-z]{10}"
	Dim regEx, match, myMatches
 
	Set regEx = New RegExp
	regEx.Pattern = IVNAME_TEST
	regex.IgnoreCase = true
 
	Set myMatches = regEx.Execute( UCase(NewUserName) )
	If myMatches.Count > 0 Then
		IsValidNewUserName = true
	End If
End function

New User Name Wizard Pane

Only Letters Error

For building custom RegEx expressions, I suggest using RegExBuddy for Windows users and Kodos for Linux users.

-Brian G

Share

MDT2012 RC1 Released

  Thanks MS! https://connect.microsoft.com/site14/content/content.aspx?ContentID=12463&http://go.microsoft.com/fwlink/?LinkId=217606 You have to grab it using your Live ID, ...

Best Completely free

  http://www.tweaknow.com/BestFreeApps.php I agreed with all of the applications listed in this ...

Change Computer Icon

Updated 2012-May-14: Found subinacl did not work on Windows 7 ...

2 simple vbs scripts

Just two simple scripts I wrote up to disable number ...

How to apply Local G

In many Organizations, the AD support team is separated from the team ...

MDT2012 RC1 Released

  Thanks MS! https://connect.microsoft.com/site14/content/content.aspx?ContentID=12463&http://go.microsoft.com/fwlink/?LinkId=217606 You have to grab it using your Live ID, ...

Change Computer Icon

Updated 2012-May-14: Found subinacl did not work on Windows 7 ...

How to apply Local G

In many Organizations, the AD support team is separated from the team ...

Creating Simple and/

Using the Wizard Editor is fairly self explanatory for adding ...

How to use VBScript

The built-in CustomSettings.INI variables are very useful, but in some ...

Sponsors

  • Elegant Wordpress Themes.
  • Flexithemes.
  • Code Canyon.
  • ThemeForest.