Exporting Multiple Registry Keys to a File

Started by jtrask, February 25, 2015, 08:39:36 AM

Previous topic - Next topic

jtrask

I have a script that will prompt the user for a string and then return a text file with a list of all the keys including that string.  I've decided that a .REG file would be more useful.

I've seen examples of exporting a single key to a .REG file, or exporting a key and all of it's child objects to a file, but nothing that would export multiple individual keys to a single file.

Now I'm thinking that easiest thing to do is read the .TXT file I'm creating now and use that to build a .REG file.  Does that seem reasonable?  Is there another/easier/better way to do this that I have missed?

td

Have you considered using the 'Reggie' Extender's 'rRegSearch' search function? 

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

jtrask

That's what I'm using to create the .TXT now.  I realized after posting that it was silly to create a file just so I can re-read it again.

Now I'm modifying my script to format its output to create a .REG file.  Joy.


td

I assume you have a good reason for creating a '.reg' file instead of some other approach.  I believe the  '.reg' format would be two lines per key for your purposes.  The first line would be the key's full path in square brackets and the second line would be the value preceded by an '@='.  Admittedly, there are a few syntax rules to follow like doubling up on backslashes in strings and the like that need to be accounted for.  But it's nothing too terribly complicated.   
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

jtrask

I have a product that doesn't always install so well that the product actually works.  It also doesn't uninstall gracefully sometimes.  The vendor has supplied me with an uninstaller that is supposed to forcibly remove the product, but I'm not finding that is the case 100% of the time.  Since I've run into this scenario before, I figured I could right something that would scan the registry for a given string, and then output all of the keys/items/data with that string.  I could just use the text file and script something to remove all of those keys, but I already have a script that will take a .REG file an merge it with the registry that could be tweaked to removed the keys in the .REG file.


jtrask

I've got a question about the Reggie Extender.  When I search @REGMACHINE on my 64-bit system, it looks like the results are a mixture of 64-bit and 32-bit registry keys.  Am I reading this correctly?  If so, how can I sort this all out?

td

Make sure you are using the latest version of the extender and then check out the rRegView function in the extender's help file.  The function controls the view (32-bit view or 64-bit view) that is searched.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

Should also mention that if you use the 64-bit view, the keys under Wow6432Node will be searched and returned.  These are the 32-bit view keys with the Wow6432Node subkey included.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

jtrask

Thank you, thank you, thank you.  That's so much more efficient that checking each both views for a few hundred registry keys!