Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi Guys
I'm having difficulties on how to solve a Problem regarding the Windows registry.
I would like to filter a list out of the all registry keys who end with "\Pisa]" or "+Partner]"(without quotes)
I have several entries in the registry who look like the example below:
[HKEY_USERS\S-1-5-21-955686789-1011868361-3389687979-20109\Software\PiSA]
.
.
[HKEY_USERS\S-1-5-21-955686789-1011868361-3389687979-19376\Software\Eigner+Partner]
.
.
As a result I'd like to have list (textfile)of ALL keys with the exact ending as described before.[HKEY_USERS\S-1-5-21-955686789-1011868361-3389687979-20109\Software\PiSA]
[HKEY_USERS\S-1-5-21-955686789-1011868361-3389687979-19376\Software\Eigner+Partner]
I'm not sure on how to do this. I thought about using REG QUERY but then I have to enter the exact registry key. This will not work because the HKEY_USERS keys have different numbers (S-1-5-21-955686789-1011868361-3389687979-20109\ in between)Do I need to export the registry first and do a search inside?
How could I do this and make a batch not to complicated :-) I appreciate your help and hope you understand what I am looking for.
Thx

Do you already have a list of all keys or do you need to create one?
=====================================
If at first you don't succeed, you're about average.M2

I don't think a .reg file is going to cooperate. It's a bit of an odd format.
=====================================
If at first you don't succeed, you're about average.M2

If you already have a .reg file, you can search it. Each key is on one line. If all you want is the full key name, just use FIND.
I thought you wanted a way of doing this more quickly than exporting the whole registry to a reg file.

hi klint
what would be a way to do it more quickly. If there is an easier or better way of doing it, i'm open. just don't know how to. :-)
looking forward for any help.
thx

I don't think there is a quicker way (but stand to be corrected) because when you do a search inside Regedit, that also takes ages.

all i thought about is not working. exporting a registry can take up to 180 MB (on a terminal server)
I figured out that using the command
findstr /C:"PiSA]" registry.reg > output_pisa.txt is not workingI don't know how to this. I'd love to search only for Registry keys who end with "PiSA]" I expect not to find more than 10 results.
any other solution how to do this?

I don't know why (I will try and find out) but for some reason it seems findstr doesn't work with .reg files. Try find instead:
find "PiSA]" registry.reg > output_pisa.txt
Also, you probably only need to export the HKCU tree instead of the whole registry, to save space.

Ok, I think I know why. Regedit 5 files are Unicode (UCS-2), and findstr doesn't like that. FIND seems ok with them though. Alternatively, you can export the registry in REGEDIT 4 format, which is "ANSI" (not Unicode). This will work with findstr, and will also be about half the size.

Hi Klint
thanks for all your input and help. I gave up with the findstr command. As you said it has to do with Unicode format. Took me a while to find out :-))
i'm trying to use
For /f %%a IN ('REG QUERY HKU') DO (
.
.
)The only thing I have to add here are "[-" at the beginning and "]" of each line because I need the string to unregister the key afterward.
hmmm, need to find out how to add characters before and after a string of each line. :-))
thanks Klint

Yes, I saw your other thread. Since you're now using reg.exe and this thread is about regedit, it's better to continue with your other thread. In fact, you don't have to bother adding [- and ] because those are only used by regedit (with .reg files) and it's easier, in a batch file, to use the REG DELETE command. Type reg delete /? for full details.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |