Thanks for replying,

the problem is that i cannot remove all the printers that are configured on the machines, i want to do the following steps.

1. Read the type of printer from the registry
2. configure the printer, that uses the new printserver.
3. remove the old connection.

I made this script, but this is only for one printer. We have about 50 printers, that means i need a script of 400 lines.

$printerpath = "HKEY_CURRENT_USER\Printers\Connections"
$hp4050 = ReadValue ("$printerpath\,,oldserver,HP4050","Server")
IF $hp4050="oldserver"
ADDPRINTERCONNECTION ("\\newserver\hp4050")
DELKEY ("$printerpath\,,oldserver,hp4050")
ENDIF

Thanks