Objective
In this lab, students will complete the following objectives.
Create a VBScript program using NotePad++.
Use procedures to modularize a VBScript program.
Create a library of procedures.
Run library procedures from a separate VBScript program.
Element K Network Connections
For this lab, we will only need to connect to vlab-PC1. The computer vlab-PC1 is the computer on the left side while vlab-PC2 is on the right. If you leave the cursor on the PC icon for a few seconds, a tool-tip message will appear indicating the hostname of the PC. Open vlab-PC1 and log in as Administrator with the password password.
Note: All captures must be text only—DO NOT capture the NotePad++ application window or the command prompt window. Use copy and paste of text only.
Task 1: Ensure that the PC_Tests Scripts are in C:\Scripts\
Open the Windows CLI Using the Desktop or Quick Launch Command Prompt icon. Change Directory to the C:\Scripts\ folder (cd \Scripts). Verify that the files PC_Tests.cmd and PC_Tests.vbs exists in this directory. If the files are absent, they can be extracted from the downloaded Doc Sharing file PC_Tests.zip.
Task 2: Open C:\Scripts\PC_Tests.cmd in NotePad++
Open NotePad++ and use File/Open to view the C:\Scripts\PC_Tests.cmd script file in the Editor window.
An analysis of the PC_Tests.cmd Batch script program is shown on the next page.
Task 2: Analyze the Batch Script File PC_Tests.cmd
One of the drawbacks of using VBScript instead of a full-featured programming language such as C++ or Java is the fact that VBScript does not have the capability to clear the command prompt screen. This is one of the things we need to do with our menu-driven PC_Tests program each time the menu is re-displayed. Since we can’t do this in VBScript, we will do it in a Batch script file.
Look at the PC_Tests.cmd Batch script shown on the right. The script performs the following tasks.