Do you have a UDF called DelPrinterConnections in your script? The built in function is without the s.

You might also look at PrinterConnection() to help you find and remove printers rather than use the Registry. PrinterConnection allows you to use the share name for both finding if it is installed, and to remove it. See the examples in the header.

PrinterConnection() -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=203840#Post203840

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1