Lab 17 Echoing the Time Zone

In this lab, you modify the script from Lab 16 so that it echoes out the time zone configured on the computer.

Lab Instructions

  1. Open Notepad.exe.

  2. Open Lab16Solution.vbs, and save it as lab17.vbs.

  3. Edit the wmiQuery so that it points to Win32_TimeZone. The code will look like the following:

    wmiQuery = "Select * from Win32_TimeZone"
  4. Inside the For Each objItem In colItems loop, delete all but one of the WScript.Echo statements so that the code looks like the following:

    For Each objItem In colItems
        WScript.Echo "Caption: " & objItem.Caption
    Next
  5. Save and run the file. You are now pointing to the Caption field of Win32_TimeZone. No further changes are required for this lab.

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.