no.
your correction will return always 0 as the state of defaulprinter check as you have already removed the old one [Razz]

I would go for:
code:
IF primapstate($key)
$nul=addprinterconnection(readprofilestring("$pmap","PRINTER_MAP",$key))
IF primapstate($key)=2
$nul=SETDEFAULTPRINTER (READPROFILESTRING("$pmap","PRINTER_MAP",$key))
ENDIF
$nul=delprinterconnection($key)
ENDIF



[ 13. March 2003, 00:51: Message edited by: Lonkero ]
_________________________
!

download KiXnet