The function I posted above works at the printer level so an example of using it would look like...

Code:

fnRemapPrinter("\\oldserver\oldprinter","\\newserver\newprinter")



Here is one that remaps printers that just move to a different server, but retain the same printer share name...

Code:

fnRemapPrinters("oldserver","newserver")

Function fnRemapPrinters($sOldServer,$sNewServer)
Dim $lIndex,$sPorts,$sServer,$sPrinter,$sPort,$sSplit,$lS,$sShare,$NUL,$Err,$sDevice,$sDefault,$sPrinterPorts
Dim $sPrinters[100]
$fnRemapPrinters=0
$lIndex=0
If @INWIN=1
$sPorts="HKCU\Printers\Connections\"
$sDefault=Split(ReadValue("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device"),",")[0]
Do
$sPrinters[$lIndex]=EnumKey($sPorts,$lIndex)
$lIndex=$lIndex+1
If Ubound($sPrinters)=$lIndex Redim Preserve $sPrinters[Ubound($sPrinters)+100] EndIf
Until @ERROR
Redim Preserve $sPrinters[$lIndex-1]
For $lIndex = 0 to Ubound($sPrinters)
$sServer=ReadValue($sPorts+$sPrinters[$lIndex],"Server")
If SUBSTR($sServer,3,LEN($sServer))=$sOldServer
$sPrinter=Split($sPrinters[$lIndex],",")[3]
$NUL=AddPrinterConnection("\\"+$sNewServer+"\"+$sPrinter)
If @ERROR
$Err=@ERROR
Else
If $sDefault="\\"+$sOldServer+"\"+$sPrinter
$NUL=SetDefaultPrinter("\\"+$sNewServer+"\"+$sPrinter)
EndIf
$NUL=DelPrinterConnection("\\"+$sOldServer+"\"+$sPrinter)
If @ERROR $Err=@ERROR EndIf
$fnRemapPrinters=$fnRemapPrinters+1
EndIf
EndIf
Next
Else
$sPorts="HKLM\System\CurrentControlSet\control\Print\Printers\"
Do
$sPrinters=EnumKey($sPorts,$lIndex)
If $sPrinters
$sPort=ReadValue($sPorts+$sPrinters,"Port")
$sSplit=Split($sPort,"\")
If $sSplit[2]=$sOldServer
$lS=Len($sPort)-Len($sOldServer)-2
$sShare=Right($sPort,$lS)
$NUL=WriteValue($sPorts+$sPrinters,"Port","\\"+$sNewserver+$sShare,"REG_SZ")
If @ERROR $Err=@ERROR EndIf
$sDevice=ReadProfileString ("Win.ini", "Windows", "Device")
$sDevice=Split($sDevice,",")
If $sDevice[2]=$sPort
$NUL=WriteProfileString ("Win.ini", "Windows", "Device",
$sDevice[0]+","+$sDevice[1]+","+"\\"+$sNewserver+$sShare)
If @ERROR $Err=@ERROR EndIf
EndIf
$NUL=WriteProfileString ("Win.ini", "Ports", $sPort)
$NUL=WriteProfileString ("Win.ini", "Ports", "\\"+$sNewserver+$sShare, " ")
If @ERROR $Err=@ERROR EndIf
$sPrinterPorts=ReadProfileString ("Win.ini", "PrinterPorts", $sPrinters)
$sPrinterPorts=Split($sPrinterPorts,",")
$NUL=WriteProfileString ("Win.ini", "PrinterPorts", $sPrinters,
$sPrinterPorts[0]+","+"\\"+$sNewserver+$sShare+","+$sPrinterPorts[2]+","+$sPrinterPorts[3])
If @ERROR $Err=@ERROR EndIf
$sDevices=ReadProfileString ("Win.ini", "Devices", $sPrinters)
$sDevices=Split($sDevices,",")
$NUL=WriteProfileString ("Win.ini", "Devices", $sPrinters, $sDevices[0]+","+"\\"+$sNewserver+$sShare)
If @ERROR $Err=@ERROR EndIf
If Not $Err $fnRemapPrinters=$fnRemapPrinters+1 EndIf
EndIf
EndIf
$lIndex=$lIndex+1
Until $sPrinters=""
EndIf
If Not $Err $Err=0 EndIf
Exit $Err
EndFunction



It will remap any printer the user has installed that is pointed to the old print server and remap it to the new print server. It will also work with 9x client, but they require a reboot whereas NT-based systems do not require a reboot.