Reader to Reader - 17 Dec 1999

This month, one scripting solution is provided: Microsoft Fixes Only Some of WSH's Printer Bugs

Readers

December 17, 1999

1 Min Read
ITPro Today logo in a gray background | ITPro Today

[Editor's Note: Email your scripting solutions (400 words or less) to Reader to Reader at [email protected]. Please include your script and phone number. We'll edit submissions for style, grammar, and length. If we print your contribution, you receive $100.]

Microsoft has taken another baby step toward fixing the bugs with the printer methods in Windows Scripting Host (WSH) 2.0. Microsoft added the AddWindowsPrinterConnection method to connect Windows NT printers. In addition, Microsoft fixed the EnumPrinterConnections method so that the method now includes all Windows printers and printers that connect to LPT devices.

However, Microsoft didn't fix the RemovePrinterConnection method. This method still doesn't work on Windows printers in an NT network. You can't look to Microsoft's Windows Management Instrumentation (WMI) for a workaround because you can't use this API to add or remove printers.

Fortunately, other sources offer COM objects to support printer connections. For example, WshPrint is a free COM object that includes a full set of methods for adding, removing, and enumerating printer connections. You can find WshPrint and other useful scriptable COM objects at http://cwashington.netreach.net.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like