If ... Then...Else
Repeat a block of statements.
Syntax
If condition Then [Statements] [Else Else-Statements]
or
If condition Then
[Statements]
[ElseIf condition-n] Then
[Statements]
[Else]
[Statements]
End If
Key
condition An expression that evaluates to True or False
Statements Program code to be executed if condition is True
Examples
hournow = hour(Time())
If hournow > 12 Then WScript.Echo "Good Afternoon"
Dim strCountry
strCountry = "USA"
If strCountry = "USA" Then
WScript.Echo "United States of America."
ElseIf strCountry = "CA" Then
WScript.Echo "Canada."
Else
WScript.Echo "Some other country."
End If