* WSH 2.0 or later must be previously installed >oWshNet = CREATEOBJECT('Wscript.Network') >* Force the local port LPT3: to be freed for reassignment, but don't change >* the default user profile information. Free the port even if not in use. >* If the printer is attached to a local port already, this and the following >* step are unnecessary, just the SetDefaultPrinter is needed. >oWshNet.RemovePrinterConnection('LPT3',.t.,.f.) >* Attach the remote printer to the local port, and do not alter the user >* profile to set this mapping as a part of the user's login process. If >* needed, you can add a user name and password to attach the share if the >* default Windows login, or the domain login authenticated by the PDC, will >* not grant access to the printer. You can substitute a call to >* AddWindowsPrinterConnection, under WinNT/Win2K, it will install the driver >* for a remote printer on the system if the driver is made available by the >* remote printer's owner; Win9x requires that the driver has previously been >* installed even if the driver is provided by the remote printer's owner. >* AddWindowsPrinterConnection lets you make a printer connection without having >* explicitly assigned it to a port, which would obviate the preceding call to >* RemovePrinterConnection, but always requires Win9x to explicitly name the >* printer driver to use, so this sequence simplifies life if the printer driver >* has been explicitly installed to the system previously. >oWshNet.AddPrinterConnection('LPT3','<i>NetBIOSName\PrintShareName</i>',.f.) Correction - the preceding line needs to include the \\ in the server name prefix: oWshNet.AddPrinterConnection('LPT3','\\<i>NetBIOSName\PrintShareName</i>',.f.) >* Force the named port to be assigned as the default Windows printer; if you >* used AddWindowsPrinterConnection, reference the share name; if it's a local >* printer, reference the right port. Note that USB-attached printers may have >* unusual or unfamiliar port names if you aren't familiar with USB device >* naming; check the printer properties if you are not sure. >oWshNet.SetDefaultPrinter('LPT3')>