On Your Own: Lab 5 Modifying CPUType.vbs

In this lab, you will modify CPUType.vbs so that it uses a Select Case format instead of multiple If...Then...ElseIf statements.

Lab Instructions

  1. Open CPUType.vbs and save it as lab5.vbs.

  2. Turn off On Error Resume Next by commenting out the line.

  3. Turn the If...Then line into a Select Case statement. The only element you must keep out of this line is objProcessor.Architecture because it is hard to type. When you are finished, your Select Case line looks like the following:

    Select Case objProcessor.Architecture
  4. Start your case evaluation. If objProcessor.Architecture = 0, you know that the processor is an x86. So your first case is Case 0. That is all you put on the next line. It looks like this:

    Case 0
  5. Leave the ...

Get Microsoft® Windows® Scripting Self-Paced Learning Guide 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.