There should be a ' around the \\sserver\share name inside the (). I don't usually have a space before the ( but not sure that matters.

To see the error on the screen, precede the text with ?

You're missing an endif. You have two If and will need matching endif. You should be getting a beep and error when running your code.

When posting code, put the word CODE surrounded by square brackets before it and /CODE with square brackets after it:
 Code:
if ingroup('ITtest')
   if ADDPRINTERCONNECTION('\\PRINT01\HB_LSC_4250')
   ? "ERROR: Failed to add printer, reason: ["+@ERROR+"] @SERROR"+@CRLF
   Else
   ? "Printer added successfully"+@CRLF
   Endif  
EndIf

ADDPRINTERCONNECTION('\\PRINT01\HB_LSC_HP')
ADDPRINTERCONNECTION('\\PRINT01\MIS_1022')
ADDPRINTERCONNECTION('\\PRINT01\OR_LSC_HP
setdefaultprinter('\\PRINT01\MIS_1022') 


Edited by tjcarst (2008-05-21 10:20 PM)