pommie,

If we go back and look at the post I referred you to - Add Printer on 9x clients!

Looking at the registry key:

quote:

$localkey = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Print\Printers"

Notice that he does an ENUMKEY..

And then an ENUMVALUE..

Let's stop here a moment. What are we trying to do? Check to see if a printer exists, if it does not add it.. Otherwise leave the routine.

What is he doing? He is looking for existence of the old printer and the new printer and if the new printer does not exist, add it in..

Look at some of the looping structures used. Pare down what is not needed like $found2 and focus on $found1. In other words, if $found1 exists, RETURN from the sub-routine or EXIT the script.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's