I've used the PrinterConnection UDF for many things including what you are doing. The version posted will handle getting/setting defaults. It also always uses the share name of the printer, no matter what action you are performing. Of note, this is an older version that works fine, but I did come up with a newer version that I never posted. I'm willing to post it if you find the need.

PrinterConnection -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=203840#Post203840

How to use UDFs -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943#Post81943

The rest of the UDFs are here -
http://www.kixtart.org/forums/ubbthreads.php?ubb=postlist&Board=7&page=1