Here is my entire test script:

AddPrinterConnection ("\\FILE\SALES_R1045")
AddPrinterConnection ("\\FILE\SALES_FAX")
SetDefaultPrinter ("SALES_R1045")

Now this should add two printers and set one of them as default. WindowsXP.

The problem is the default isn't setting itself and I get a return code of "2". Here's the odd part. If I add:
SetDefaultPrinter ("\\FILE\SALES_R1045")

right above my initial SetDefaultPrinter and run the script then it still doesn't work. Run the script a second and it works!

Remove that line and it doesn't matter how many times I run the script it wont set the printer as default.

Ideas?