balafrus dear,
there is @ERROR line in YOUR SCRIPT.
what does it say?!?
I'm 110% sure that it did not say what you told me.

anyway, the problem is that setdefaultPrinter() wants the printer name, not share name.
_________________________
!

download KiXnet