(imported topic written by Braian)
HI All,
Is it possible to list all connected printers only? not all installed?
Thanks,
Braian
(imported topic written by Braian)
HI All,
Is it possible to list all connected printers only? not all installed?
Thanks,
Braian
(imported comment written by mcalvi91)
manipulate this as needed
substrings after
"="
of
(selects
"portName from win32_printer where network=‘true’"
of
wmi
as
string
as
lowercase)
(imported comment written by Braian)
Hi mcalvi91,
thanks for the reply, what i mean is physically connected printers,
Thanks,
Braian
(imported comment written by Braian)
is there a property that can be check either a printer is connected?
Braian
(imported comment written by mcalvi91)
try changing network=‘true’ to network=‘false’
see if that will solve your use case.
(imported comment written by Braian)
Hi mcalvi91,
network = connected through network right?whats for physically connected or physically attached printer.
Thanks,
Braian
(imported comment written by mcalvi91)
Here is the w32_printer class from MS. You can look at the properties to find the filtering logic you need.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394363(v=vs.85).aspx
(imported comment written by Tim.Rice)
From a machine that has a printer connected in the manner you want to detect, try the following two phrases using the QnA or Fixlet Debugger tools.
selects “* from win32_printer” of wmi as string as lowercase
and
names of keys whose (exists name of it as version) of key “HKLM\SYSTEM\CurrentControlSet\Enum\USBPRINT” of registry
The first will give you a listing of the available WMI properties for each of the installer printers. Look for something to differentiate the printers you are interested in. It might be that the PortName is what you are interested in. I assume you are looking for devices with USB or Parallel printer connections (if anyone still uses these!!). I don’t have a directly connected printer, mine are all TCPIP connected so the PortName is the DNS name used to connect to the printer.
The second phrase should give you a list of all USB Printers that have been connected to the computer. You may have to include additional logic to determine if the printer is currently connected or simply one that has been connected at some point in the past and the USB driver loaded.
(imported comment written by Braian)
Thanks for all the reply, I have tried to check property that will change if i connect/disconnect a printer from my laptop but i have the same result. i have read also
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394363(v=vs.85).aspx
but didnot find any answer. Any Suggestion?
Thanks,
Braian
ex.
A: name=hp deskjet 3510 series
A: printerstate=0
A: printerstatus=3
A: status=unknown
A: detectederrorstate=0
A: extendeddetectederrorstate=0
A: extendedprinterstatus=2