These two functions can help you:
IsInSubnet() - Checks if a given IP address is in a specified subnet
EnumIPInfo()
Loop through all the IP Addresses you can find on your computer and if your computer is in a certain subnet like 10.250.2.0/27 (10.250.2.0-10.250.2.31), you can add printers and set one as default. Maybe for that you can use a select statement or an IN file or so.
Maybe this can help:
http://www.kixtart.org/forums/ubbthreads...true#Post166337