Here is a script I use to move my win95 clients to our new LINUX print server.

The script has one obvious fault in that it scrolls through all the printers and changes them all (even if they are fax managers).

An IF statement should fix that.

cls
$INDEX=0
:GETPRINTER ;gets printer Name and Port
$PRINTER=ENUMKEY ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Print\Printers",$INDEX)
$PORT=ENUMVALUE ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Print\Printers\$PRINTER",5)
? @ERROR
IF @ERROR=0

; If printer name is the same as printer port, printer is moved to new server
IF $PDATA="\\asteryx\"+"$PRINTER" GOTO END
$PDATA=READVALUE ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Print\Printers\$PRINTER","$PORT")
?"Printer Found: $PRINTER on $PDATA"
IF $PDATA="\\rfaserver2\"+"$PRINTER"
WRITEVALUE ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Print\Printers\$PRINTER","$PORT","\\asteryx\$PRINTER","REG_SZ")
$NPDATA=READVALUE ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Print\Printers\$PRINTER","$PORT")
?"Printer $PRINTER Changed to Port $NPDATA"
$INDEX=$INDEX+1
GOTO GETPRINTER
ELSE

; If printer name is DIFFERENT than Port name
$PDATA=SUBSTR($PDATA,14,20) ;subtracts "\\rfaserver2\" from the data
WRITEVALUE ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Print\Printers\$PRINTER","$PORT","\\asteryx\$PDATA","REG_SZ");moves the port
WRITEVALUE ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Print\Printers\$PRINTER","NAME","$PDATA","REG_SZ");renames the printer
$NPDATA=READVALUE ("HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Print\Printers\$PRINTER","$PORT")
?"Printer $PRINTER Changed to Port $NPDATA"
$INDEX=$INDEX+1
GOTO GETPRINTER

:END
RETURN

------------------
Tony Reno
renoa@rfa.org