Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    REG QUERY WildCards

    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
    Code:
    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.

  • #2
    New to the CF scene
    Join Date
    Jun 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •