Skip to content

Net_EnumPrinterPaths

Enumerates the printer connections of the account that runs the script. gaValue contains the printer names, which is the UNC path for network printers, in the same order as Net_EnumPrinters.

Net_EnumPrinterPaths() As Boolean

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.

If bStatus Then bStatus = Net_EnumPrinterPaths()
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)
Next
End If

Scripting Guidelines

Net_AddPrinter Net_SetDefaultPrinter Net_DeletePrinter Net_EnumPrinters Constants Package Property Variables