Please post your code or an example of your code.

Keep in mind SetDefaultPrinter uses the printer name, not printer share. It is suggested that you use the same name for the printer and the share to avoid this problem.