The following code will map a (or a aet of) printers based on the third octet of the gateway ip of the local host. Modify and add the correct "\\server\printer" statements in the SELECT CASE statement in the mapPrinters subroutine.
=================================================================
Option Explicit
mapPrinters(getSubnet)
Function getSubnet
Dim wmi, NICs, NIC, temp
Set wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set NICs = wmi.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled=True")
temp = ""
For Each NIC In NICs
If Not IsNull(NIC.DefaultIPGateway)Then
temp = Split(NIC.DefaultIPGateway(0),".")(2)
Exit For
End If
Next
getSubnet = temp
End Function
Sub mapPrinters(subnet)
Dim network
Set network = CreateObject("WScript.Network")
Select Case subnet
Case 0
network.AddWindowsPrinterConnection "\\server\printer1"
network.AddWindowsPrinterConnection "\\server\printer2"
Case 1
network.AddWindowsPrinterConnection "\\server\printer3"
network.AddWindowsPrinterConnection "\\server\printer4"
End Select
End Sub