View Full Version : REG QUERY WildCards

05-21-2009, 04:36 PM

I was searching around the net trying to find some sort of way to go about this, but all my searches have been in vain.

I'm trying to get a list of all the printers attatched to a PC by using REG QUERY and querying the
HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers\"*" /v Port >> c:\printers.log to find the ports to those printers and then putting all that information to a log file.

Unfortuneately, that does not work as intended, and just lists the Printer..nothing else. The only way I get it to list the port value is using the /s which spits out any and all information under the \Printers\ key...which is mostly all un neccesary.

If anyone knows a way about this, I will greatly appreciate it.

Thank you.

06-27-2013, 01:57 PM
echo Off

set KEY_NAME="HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers"
set VALUE_NAME=release

REG QUERY %KEY_NAME% /S /v %VALUE_NAME% > c:\printer.log


change the value_name with your query