...

View Full Version : REG QUERY WildCards



cronotrigger
05-21-2009, 03:36 PM
Hello,

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.

justintjacob
06-27-2013, 12:57 PM
echo Off
setlocal ENABLEEXTENSIONS

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

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

endlocal

change the value_name with your query



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum