Microsoft® Windows® Script Host
EnumPrinterConnections Method
WSH Reference
Version 1

See Also                      Applies To


Description
Returns the current network printer mappings.
Syntax
objPrinters = object.EnumPrinterConnections
Parameters
Part Description
object WshNetwork object.
objPrinters Variable reference to the collection of printers.
Remarks
Items in this collection are local names and remote names. The first item in the collection is the port and the second item is the network mapping. This pattern continues for all the network printers in the collection.

Example
The following example outputs the printer ports and network mappings:

Set WshNetwork = WScript.CreateObject("WScript.Network")
Set oPrinters = WshNetwork.EnumPrinterConnections
For i = 0 to oPrinters.Count -1
	WScript.Echo oPrinters.Item(i)
Next