Chapter 3. Adding Intelligence

Before You Begin

To successfully complete this chapter, you need to be familiar with the following concepts, which were presented in Chapter 1 and Chapter 2:

  • Declaring variables

  • Basic error handling

  • Connecting to the file system object

  • Using For Each...Next

  • Using Do While

After completing this chapter, you will be able to:

  • Use If...Then

  • Use If...Then...ElseIf

  • Use If...Then...Else

  • Use Select Case

  • Use intrinsic constants


If...Then is one of those programming staples (like fried chicken and mashed potatoes are staples in the southern United States). What’s nice about If...Then is that it makes sense. We use this kind of logic all the time.

The basic operation is diagrammed here:






store is open

Then ...

Get Microsoft® VBScript Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.