Do
$Subnet = EnumIPInfo($x,3,1)
$x = 1+$x
Until Len($Subnet)

It simply does a Do Until loop, that does the EnumIPInfo() everytime it runs until the $Subnet variable contains data. Since you don't know which adapter it is that actually contains the info you want, it starts at 0, and increments by one every loop.

The rest of the code is pretty much what you already had, except for displaying them using the ?'s at the end.