Solved reg.exe won't query subkeys

umphorton

New member
Local time
6:00 AM
Messages
6
-Windows 7 Professional 64bit.
-Command is executed from an elevated command prompt.
-It worked yesterday

If I type reg query HKLM/Software ... I get all the subkeys under Sofware.

If I type reg query HKLM /f Software... I get...
HKEY_LOCAL_MACHINE\SOFTWARE
End of search: 1 match(es) found.

If I type reg query HKLM\software\Policies... I get
HKEY_LOCAL_MACHINE\software\Policies\ActivIdentity
HKEY_LOCAL_MACHINE\software\Policies\Adobe
HKEY_LOCAL_MACHINE\software\Policies\Microsoft
HKEY_LOCAL_MACHINE\software\Policies\Tumbleweed

Now is where I run into problems...

If I type reg query HKLM /f policies... I get
End of search: 0 match(es) found.

No matter what key I try this with I get the same result.

Oh and reg delete will successfully delete a key in the place as the two mentioned above.

Any ideas?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell
OS
Windows 7 32 and 64 bit
reg query hklm /f Software does work and I get this...
HKEY_LOCAL_MACHINE\SOFTWARE
End of search: 1 match(es) found.

It seems like it is having problems with each hive at the 2nd subkey level and below. e.g. HKEY_LOCAL_MACHINE\SOFTWARE\Policies.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell
OS
Windows 7 32 and 64 bit
I can also do this...
reg query "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\LowRegistry\DOMStorage\shop.nuan
ce.com"
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\LowRegistry\DOMStorage\shop.nuance.com
(Default) REG_DWORD 0x0

but not reg query HKCU /f "shop.nuance.com" or reg query HKCU /f shop.nuance.com
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell
OS
Windows 7 32 and 64 bit
Not sure what this is supposed to do: reg query hklm /f Software

What is the /f for? The query should be reg query hklm\Software and on my system returns:

C:\WINDOWS\system32>reg query HKLM\software

HKEY_LOCAL_MACHINE\software\7-Zip
HKEY_LOCAL_MACHINE\software\AGEIA Technologies
HKEY_LOCAL_MACHINE\software\ATI Technologies
HKEY_LOCAL_MACHINE\software\BillP Studios
HKEY_LOCAL_MACHINE\software\Brother
HKEY_LOCAL_MACHINE\software\Classes
HKEY_LOCAL_MACHINE\software\Clients
HKEY_LOCAL_MACHINE\software\Code Sector
HKEY_LOCAL_MACHINE\software\CyberLink
HKEY_LOCAL_MACHINE\software\Dell
HKEY_LOCAL_MACHINE\software\Dolby
HKEY_LOCAL_MACHINE\software\DTS
HKEY_LOCAL_MACHINE\software\Foxit Software
... ... ... ... ...
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
Not sure what this is supposed to do: reg query hklm /f Software

What is the /f for?

It seems to allow for a search term.

Code:
c:\>reg query /?

REG QUERY KeyName [/v [ValueName] | /ve] [/s]
          [/f Data [/k] [/d] [/c] [/e]] [/t Type] [/z] [/se Separator]

  KeyName  [\\Machine\]FullKey
           Machine - Name of remote machine, omitting defaults to the
                     current machine. Only HKLM and HKU are available on
                     remote machines
           FullKey - in the form of ROOTKEY\SubKey name
                ROOTKEY - [ HKLM | HKCU | HKCR | HKU | HKCC ]
                SubKey  - The full name of a registry key under the
                          selected ROOTKEY

  /v       Queries for a specific registry key values.
           If omitted, all values for the key are queried.

           Argument to this switch can be optional only when specified
           along with /f switch. This specifies to search in valuenames only.

  /ve      Queries for the default value or empty value name (Default).

  /s       Queries all subkeys and values recursively (like dir /s).

  /se      Specifies the separator (length of 1 character only) in
           data string for REG_MULTI_SZ. Defaults to "\0" as the separator.

 [COLOR=Red] /f       Specifies the data or pattern to search for.
           Use double quotes if a string contains spaces. Default is "*".
[/COLOR]
  /k       Specifies to search in key names only.

  /d       Specifies the search in data only.

  /c       Specifies that the search is case sensitive.
           The default search is case insensitive.

  /e       Specifies to return only exact matches.
           By default all the matches are returned.

  /t       Specifies registry value data type.
           Valid types are:
             REG_SZ, REG_MULTI_SZ, REG_EXPAND_SZ,
             REG_DWORD, REG_QWORD, REG_BINARY, REG_NONE
           Defaults to all types.

  /z       Verbose: Shows the numeric equivalent for the type of the valuename.

Examples:

  REG QUERY HKLM\Software\Microsoft\ResKit /v Version
    Displays the value of the registry value Version

  REG QUERY \\ABC\HKLM\Software\Microsoft\ResKit\Nt\Setup /s
    Displays all subkeys and values under the registry key Setup
    on remote machine ABC

  REG QUERY HKLM\Software\Microsoft\ResKit\Nt\Setup /se #
    Displays all the subkeys and values with "#" as the seperator
    for all valuenames whose type is REG_MULTI_SZ.

  REG QUERY HKLM /f SYSTEM /t REG_SZ /c /e
    Displays Key, Value and Data with case sensitive and exact
    occurrences of "SYSTEM" under HKLM root for the data type REG_SZ

  REG QUERY HKCU /f 0F /d /t REG_BINARY
    Displays Key, Value and Data for the occurrences of "0F" in data
    under HKCU root for the data type REG_BINARY

  REG QUERY HKLM\SOFTWARE /ve
    Displays Value and Data for the empty value (Default)
    under HKLM\SOFTWARE
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Employer provided Dell Latitude
OS
W7 Pro SP1 64bit
CPU
i7
Memory
8GB
Graphics Card(s)
Intel HD Graphics
Hard Drives
crappy SSD
Antivirus
Employer mandated Symantec Endpoint Protection
Browser
Pale Moon 64bit, IE11 64bit & Chrome 64bit
According to Technet; "This parameter only returns entries that are in the tier directly below the specified subkey. Entries that are located in subkeys under the current subkey will not be found. When EntryName is omitted, all entries under the subkey are returned. "

You can try experimenting with the /s switch, I am getting mixed results. See for yourself

Code:
C:\Users\User>reg query hklm\software\policies /s /f windows
HKEY_LOCAL_MACHINE\software\policies\Microsoft\SQMClient\Windows
HKEY_LOCAL_MACHINE\software\policies\Microsoft\Windows
HKEY_LOCAL_MACHINE\software\policies\Microsoft\Windows NT
HKEY_LOCAL_MACHINE\software\policies\Microsoft\Windows NT\Windows File Protection
Arama sonu: 4 eşleşme bulundu. (found 4)
 
With /e switch added
C:\Users\User>reg query hklm\software\policies /s /f windows /e
HKEY_LOCAL_MACHINE\software\policies\Microsoft\SQMClient\Windows
HKEY_LOCAL_MACHINE\software\policies\Microsoft\Windows
Arama sonu: 2 eşleşme bulundu. (found 2)
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64 SP1
CPU
AMD Phenom 2 1090T
Motherboard
Gigabyte GA-890FXA-UD5
Memory
2x8GB Kingston HyperX Fury Black 1600Mhz Unganged
Graphics Card(s)
MSI GTX 970 Gaming 4G
Sound Card
Realtek On-Board HD 7.1 Audio / Logitech G35
Monitor(s) Displays
3xAcer GD245HQ
Screen Resolution
1920x1080
Hard Drives
Samsung 850 Pro 512GB SSD - OS /
WD Caviar Black SATA 3 - 1 TBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GB - Internal Backup /
Seagate Barracude SATA 3 - 3TB - External Backup/ Sync
PSU
HighPower 1000W
Case
Cooler Master HAF 932
Cooling
Noctua NH-D14
Keyboard
Logitech G19
Mouse
Logitech G500
Internet Speed
100/4 Mbit Cable (100GB quota)
Antivirus
ZoneAlarm Extreme Security / MBAM Pro / MBAE Free / SAS Free
Browser
IE 11 - Firefox - Chrome
Other Info
Logitech F710/ G27/ G940/ Z5500 // TrackIR 5 // Nvidia 3D Surround Vision
I too, think that the OP wants to search an entire hive for a specific key name. The Reg Query for that would be like,
Code:
reg query [COLOR="Red"]HKXX[/COLOR] /f [COLOR="red"]KeyNameToFind[/COLOR] /s /k /e


You can try experimenting with the /s switch, I am getting mixed results.
What is so mixed result-y?
 

My Computer

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
Sorry it was a vague argument :)

I couldn't manage to find the exact search commands for what I wanted to search (while testing).
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64 SP1
CPU
AMD Phenom 2 1090T
Motherboard
Gigabyte GA-890FXA-UD5
Memory
2x8GB Kingston HyperX Fury Black 1600Mhz Unganged
Graphics Card(s)
MSI GTX 970 Gaming 4G
Sound Card
Realtek On-Board HD 7.1 Audio / Logitech G35
Monitor(s) Displays
3xAcer GD245HQ
Screen Resolution
1920x1080
Hard Drives
Samsung 850 Pro 512GB SSD - OS /
WD Caviar Black SATA 3 - 1 TBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GBx2 - Dynamic RAID 0 /
WD Caviar Green SATA 2 - 640GB - Internal Backup /
Seagate Barracude SATA 3 - 3TB - External Backup/ Sync
PSU
HighPower 1000W
Case
Cooler Master HAF 932
Cooling
Noctua NH-D14
Keyboard
Logitech G19
Mouse
Logitech G500
Internet Speed
100/4 Mbit Cable (100GB quota)
Antivirus
ZoneAlarm Extreme Security / MBAM Pro / MBAE Free / SAS Free
Browser
IE 11 - Firefox - Chrome
Other Info
Logitech F710/ G27/ G940/ Z5500 // TrackIR 5 // Nvidia 3D Surround Vision
Back
Top