Go Back   Tech Support Forum > Microsoft Support > Windows XP Support

User Tag List

[SOLVED] Manually Export individual registry keys from command line or any other way?

This is a discussion on [SOLVED] Manually Export individual registry keys from command line or any other way? within the Windows XP Support forums, part of the Tech Support Forum category. Manually Export individual registry keys or a specified bunch of Reg Keys by command line or a batch file or


Closed Thread
 
Thread Tools Search this Thread
Old 04-19-2010, 09:14 AM   #1
Registered Member
 
Join Date: Aug 2007
Posts: 80
OS: WinXP SP2, Win 7



Manually Export individual registry keys or a specified bunch of Reg Keys by command line or a batch file or any other way that doesnt involve opening regedit and moving to the specified key and manually exporting it....

Even if it needs the use of some softwares, it would do..
andyarok is offline  
Sponsored Links
Advertisement
 
Old 04-19-2010, 12:52 PM   #2
Microsoft MVP
 
TheOutcaste's Avatar

Microsoft Most Valuable Professional
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 3,339
OS: MS-Dos 6.22 - Win7



You can use regedit from the command line
Regedit /E filename.reg [key to export]
If you don't specify a key, the entire registry is exported
Example:
Regedit /E "%userprofile%\Desktop\Batfile.reg" hkey_classes_root\batfile
Will export the HKCR\Batfile key to a file named batfile.reg on your desktop.
You can't use the short version for the key name, it has to be spelled out, so HKCR can't be used in the above example.

Or you can use reg.exe commands to add, deleted, query, or export keys.
__________________
Microsoft MVP - Windows Expert - Consumer
Of course I know all the answers; I just don't always match the answers to the right questions.
Rated R for Violence -- When your PC flies through a window, that's violent, right?
TheOutcaste is offline  
Old 04-19-2010, 01:50 PM   #3
Registered Member
 
Join Date: Aug 2007
Posts: 80
OS: WinXP SP2, Win 7



Thank you for your quick reply.
Ya, knew it. But am a bit skeptical using it. Sorry for being less informative in my previous post.

Let me explain in detail what I need. First am adding some data into registry, before that I want to know whether there exist any similar keys in the registry. If so I wanted it to be backed up, then I will add these keys, later Once I finish using it, I will remove the Keys that I added and restore those keys that existed.

I feel it could be done using a bat file using the command line options you gave.. I would still love to know if there is an easy way, coz the amount of keys I want to add is pretty large. Awaiting your reply... Thank you once again..
andyarok is offline  
Sponsored Links
Advertisement
 
Old 04-20-2010, 12:14 AM   #4
Registered Member
 
Join Date: Aug 2007
Posts: 80
OS: WinXP SP2, Win 7



To be precise, I have exactly 3220 reg keys to back up. I cannot manually backup each key. Though I could use office Macro and create a bat file to backup individual keys, even then it would create 3220 reg files.

So, Is there a way to export multiple keys to reg file or is there a way to export to a same reg file multiple times. Either of the above would help.
andyarok is offline  
Old 04-20-2010, 01:21 AM   #5
Microsoft MVP
 
TheOutcaste's Avatar

Microsoft Most Valuable Professional
 
Join Date: Mar 2009
Location: Portland, OR
Posts: 3,339
OS: MS-Dos 6.22 - Win7



Only way to do it in one file is to export the parent key. If these are under
HKEY_CURRENT_USER\Software\MyProgram\Key1
HKEY_CURRENT_USER\Software\MyProgram\Key2
HKEY_CURRENT_USER\Software\MyProgram\Key3200

You would export HKEY_CURRENT_USER\Software\MyProgram
If they are divided up under 5 parent keys for example, you just need to export those 5 parent keys.

If they are spread through out HKEY_CURRENT_USER\Software, you would have to export the entire HKEY_CURRENT_USER\Software key This would undo any changes other programs make to their registry keys in between the time you back up and restore that key.

Do these 3220 keys have Subkeys under them? And do the Subkeys have Subkeys?
You'd have to have a list of the 3220 keys to read, read in each item from the list, Recursively query the registry for that key to get all of it's subkeys and the subkey's subkeys, then query again to get the Value names, Value types, and value data for each key/subkey found, then build a batch file to add those values back in using Reg Add.
If none of the 3220 keys have any subkeys, you can skip the recursive query, and just query for the values
Once that is done, you can merge a precreated .reg file with the values you want.
To restore, you would merge a precreated .reg file to remove your values, then run the batch file you created to put back the values you backed up.
__________________
Microsoft MVP - Windows Expert - Consumer
Of course I know all the answers; I just don't always match the answers to the right questions.
Rated R for Violence -- When your PC flies through a window, that's violent, right?
TheOutcaste is offline  
Old 04-20-2010, 06:59 AM   #6
Registered Member
 
Join Date: Aug 2007
Posts: 80
OS: WinXP SP2, Win 7



yes, it does have a subkeys....
andyarok is offline  
Old 04-20-2010, 07:04 AM   #7
Registered Member
 
Join Date: Aug 2007
Posts: 80
OS: WinXP SP2, Win 7



I have done some tweaking..will let you know....
andyarok is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is on
Smilies are on
[IMG] code is on
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Post a Question


» Site Navigation
 > FAQ
  > 10.0.0.2
Powered by vBadvanced CMPS v3.2.3


All times are GMT -7. The time now is 01:28 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.1.0 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright 2001 - 2018, Tech Support Forum

Windows 10 - Windows 7 - Windows XP - Windows Vista - Trojan Removal - Spyware Removal - Virus Removal - Networking - Security - Top Web Hosts