Try this:

Code:
 

Break on

$Count = 0
$PRNKey = "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices"

While @ERROR = 0
$OldPrinterName = EnumValue ($PRNKey,$Count)
If @ERROR Exit 0 EndIf

$NewPrinterName = Split($OldPrinterName,"\")[Ubound(Split($OldPrinterName,"\"))]

If $NewPrinterName <> $OldPrinterName
Run '%COMSPEC% /c rundll32 printui.dll,PrintUIEntry /Xs /n "$OldPrinterName" printername "$NewPrinterName"'
EndIf
$Count = $Count + 1
Loop

Exit 0




The rundll doesnt return an errorcode, so if an error occurs you'll get a pop-up.
_________________________
Eternity is a long time, especially towards the end. - W.Allan