Looks good to me. One thing - you should "silence" your function calls, so that funky 0's (zeros) dont get displayed to your nicely formatted login window, have you noticed them ? Silence them (all) like this:

$rs = DelPrinterConnection ("\\YOUR SERVER NAME\YOUR PRINTER NAME")