I've just tried this code in a MS 2003 terminal server environment and am having exactly the same intermittent result as delprinterconnection("").

The script works reliably when called from a mapped drive in a TS session but doesn't remove printers when run as a login script.

Any tips? I'm mystified.

Thanks,

Greg.