Net_EnumPrinters
Description
Section titled “Description”Enumerates the printer connections of the account that runs the script. gaValue contains the local name (port) of each printer connection, as Windows reports it. To get the printer names, use Net_EnumPrinterPaths.
Syntax
Section titled “Syntax”Net_EnumPrinters() As Boolean
Return value
Section titled “Return value”Result will be stored in gaValue.
UBound(gaValue) is the number of items found. The array always has one extra, empty element at the end, so skip empty elements when you loop through it.
Example
Section titled “Example”If bStatus Then bStatus = Net_EnumPrinters()If bStatus And IsArray(gaValue) Then For index = LBound(gaValue) To UBound(gaValue) If bStatus And gaValue(index) <> "" Then bStatus = Job_WriteLog("Custom", "Index #" & index & ": " & gaValue(index), bStatus, True) NextEnd IfRelated functions
Section titled “Related functions”Net_AddPrinter Net_SetDefaultPrinter Net_DeletePrinter Net_EnumPrinterPaths Constants Package Property Variables