I don't think that DelPrinterConnections() will work correctly.

First of all, you're using both $c and $counter as indexing variable. Secondly, if you delete a registry key, then the next key moves up in the index. Thus deleting the key and increasing the index will only delete every other key. Jooels UDF seems to be wrong, too, in that regard.
_________________________
There are two types of vessels, submarines and targets.