@Glenn....Thank you for the code and explanantions.

I've seen UDF listed many times before, so I've done some reading on that. I also saw a few code examples of setting the default printer, including using a UDF function.

I would think you would need to re-arrange the code some to Add Printer and Set Default Printer before Removing Printer. Even though I don't think this is correct (and I haven't tested this yet), I've come up with this:

 Code:

$aPrinters = 'Print1', 'Print2', 'Print3', 'Print4', 'Print5', 'Print6'
$OldSvr = '\\OLDPS\'
$NewSvr = '\\NEWPS\'

For Each $Printer in $aPrinters  ; enumerate list of all printer names
  If PriMapState($OldSvr + $Printer) ; is it mapped to old server?
    AddPrinterConnection($NewSvr + $Printer)  ; connect to new server
 	if not @error
	  if Primapstate($Printer) = 2
	    $rc=SetDefaultPrinter($Printer)  ; set default printer
	  endif
	    DelPrinterConnection($OldSvr + $Printer)  ; disconnect from old
	EndIf	
  EndIf
Next  ; check next printer

; PriMapState UDF Function
function PriMapState($_Pri)
	if len(readvalue("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Devices",$_Pri))
		if split(readvalue("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows","Device"),",")[0]=$_Pri
			$PriMapState=2
		else
			$PriMapState=1
		endif
	endif
endfunction



It seems wrong since I wouldn't think I would call PriMapState twice.

Thank you,