Have you tried to set the default printer this way:
code:
If AddPrinterConnection ("\\hercules\4050") = 0
? "Added printer connection...."
sleep 1

$RC= SetDefaultPrinter ("\\hercules\4050") = 0
If @Error=0
? "Set default printer to HP LaserJet 4...."
sleep 1
ELSE
? ''+@ERROR+' - '+@SERROR
sleep 1
Endif
ELSE
? ''+@ERROR+' - '+@SERROR
sleep 1
Endif

It seems to me that this is the difference between your code and Radimus' code [Wink]
_________________________
Kind regards,