On Your Own: Lab 1 Exploring a VBScript

In this section, you will explore the parts of a VBScript.

Lab Instructions

  1. Open the Lab1 folder located on the companion CD-ROM. From there, open the DisplayComputerNames.vbs script in Notepad.

  2. Add comments that identify each section of the script. (Make sure to include all four parts of the script: Header information, Reference information, Worker information, and Output information.)

  3. Save the script with a different filename, such as lab1.vbs.

  4. Delete the entire Header information section.

  5. Save the script, and then try to run it. Does it run?

  6. Add the Option Explicit command again, and save the file. Now does it run?

  7. Put a comment mark (’) in front of Option Explicit, and save the file. Does it run?

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.