I am new to posting and to KIXtart. I appreciate any advice I can get with this problem. My workstations are all in groups, I am calling a udf file to determine which printers to map, which is working great. I can not get the SetDefaultPrinter function to work at all though.

Before posting I spent time looking over the site, but everything was verifying the code was correct.
Code:

Call '\\PHI2\NETLOGON\Computeringroup.udf'

; Product Types will have to be added for additional operating systems
If @PRODUCTTYPE = "Windows NT Workstation"
Or @PRODUCTTYPE = "Windows 2000 Professional"
Or @PRODUCTTYPE = "Windows XP Professional"

If ComputerInGroup('ph_prt_confroom_area')=1
If AddPrinterConnection ("\\phi2\copier2") = 0
? "Added printer connection...."
If SetDefaultPrinter ("\\phi2\copier2") = 0
? "Default printer was set to \\phi2\copier2...."
Else
? "Set Default Failed"
? "Error Code: " +@ERROR
EndIf
EndIf
EndIf


As you can see I put some if statements in there. When the code is run, the following is returned.
****
z:\kix32 mapprinters.kix
Added printer connection....
Default printer was set to \\phi2\copier2....
Set Default Failed
Error Code: 2
z:\
****

Thanks very much in advance for any assistance on this. I will be sure to follow up and let you know how things turn out.

Skip
_________________________
-sphilip