Okay, so I am writing a script to install "local" printers via IP addresses, and have found that I need to make modifications to the registry in order to do so. In Windows 7 however, they have introduced a new key into the TCP/IP Port registry keys called "PortMonMibPortIndex" which essentially just tells the registry what order the ports are listed in. This presents a problem for me though, as I am wanting to write this script to install the port to the next available Index number.
What I am looking for is for a way to tell how many folders(/keys) are within a folder in the registry.