One of VBScript's quirkiest areas is resizable arrays (commonly known as dynamic arrays). The method for working with these arrays is not intuitive and thus hard to master and remember. I'm going to demonstrate-the process for creating and resizing a dynamic array to contain IP addresses associated with a computer, then discuss how the Microsoft Scripting Runtime Library's Dictionary object (aka dictionary) is an improvement over VBScript's native dynamic arrays.
Collecting Computer IP Addresses
Windows Management Instrumentation's (WMI's) Win32_NetworkAdapter Configuration class exposes IP address information on a computer, but this information has a complex structure. Computers usually have more than one instance of the class because everything from COM ports to VPN connections to VMware's and Microsoft Virtual PC's virtual networks have virtual adapters. Furthermore, an adapter can theoretically have multiple IP addresses, so the IPAddress property for each class instance is an array, even if it has only one address. . . .