Moving Past Lame Arrays

I will admit the previous script was pretty lame. But because the construction of an array is very finicky, I wanted you to have a reference for the basic array (you will need it for your labs).

In the next script (ArrayReadTxtFile.vbs), you open up a text file, parse it line by line, and write the results into an array. You can use this line-parsing tactic later as a way to feed information into a more useful script. Right now, all you’re doing with the array after it is built is echoing its contents out to the screen.

Option Explicit On Error Resume Next Dim objFSO Dim objTextFile Dim arrServiceList Dim strNextLine Dim i Dim TxtFile Const ForReading = 1 TxtFile = "c\scripts\ServersAndServices.txt" Set objFSO = CreateObject("Scripting.FileSystemObject") ...

Get Microsoft® Windows® Scripting Self-Paced Learning Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.