As a requirement from customer we need to enumerate all printers connected to the system but "virtual" / document printers.
We tried to list printers via WMI (SELECT * FROM Win32_Printer
)
or using LocalPrintServer
.
It seems that there is no property which will says this printer is "virtual".
Situation
By default Windows comes with Microsoft XPS Document Writer, Fax, Microsoft Print to PDF.
My system has also two other printers, one local (Cannon MG300 series) and one network (UTAX 3206ci).
Also I installed Snagit, Universal Document Converter, OneNote and NovaPDF.
When I list my printers I've got
Universal Document Converter
novaPDF 10
Snagit 2019
Send To OneNote 16
OneNote
Microsoft XPS Document Writer
Microsoft Print to PDF
Fax
Canon MG3000 series
3206ci
Desired behaviour
I'd like to achieve
Canon MG3000 series
3206ci
Yes, of course, we can do some heuristics to somehow filter according to driver name, port value, but some of these printers still can slip trough.
Is there a way how to do it with 100% certainty?