PC Review


Reply
Thread Tools Rate Thread

Convert hive file into .reg file?

 
 
Al Dubovick
Guest
Posts: n/a
 
      2nd Nov 2003
Many file associations are lost. Need to replace the entire subkey
HKLM\Software\Classes with another previously saved subkey. The replacement
was saved via Save Key from a backed up hive that was previously loaded and
unloaded in regedt32. Although I'm Admin, regedt32 is not giving me
privilege to do Registry > Restore on the Classes subkey with the previously
saved replacement.

Note that Load Hive is unavailable on selected subkeys; you can do it only
at the root of the HKLM tree.

So my workaround idea is to try to convert the extensionless subkey file
(Classes) into a .reg file and then import it. Is there a way to convert a
registry file into registry script file (.reg)? Note that I tried simply
putting a .reg extension on the Classes file, but when I double-click on it
a popup error states that it's not registry script. I've also tried opening
the extensionless Classes file with Notepad via Open With, but the Notepad
window doesn't show registry script.


 
Reply With Quote
 
 
 
 
Knack
Guest
Posts: n/a
 
      3rd Nov 2003

"Mark V" <(E-Mail Removed)> wrote in message
news:Xns9427CFD1171DEz9zzaQ2btw@207.46.248.16...
> In microsoft.public.win2000.registry Al Dubovick wrote:
>
> > Many file associations are lost. Need to replace the entire subkey
> > HKLM\Software\Classes with another previously saved subkey. The
> > replacement was saved via Save Key from a backed up hive that was
> > previously loaded and unloaded in regedt32. Although I'm Admin,
> > regedt32 is not giving me privilege to do Registry > Restore on
> > the Classes subkey with the previously saved replacement.
> >
> > Note that Load Hive is unavailable on selected subkeys; you can do
> > it only at the root of the HKLM tree.
> >
> > So my workaround idea is to try to convert the extensionless
> > subkey file (Classes) into a .reg file and then import it. Is
> > there a way to convert a registry file into registry script file
> > (.reg)? Note that I tried simply putting a .reg extension on the
> > Classes file, but when I double-click on it a popup error states
> > that it's not registry script. I've also tried opening the
> > extensionless Classes file with Notepad via Open With, but the
> > Notepad window doesn't show registry script.

>
> One thought. Can you load that saved hive file into regedt32 again?
> If so, you can then start regedit and see the "loaded hive" (and
> export). Close regedit, unload hive, close regedt32.
>
> I do not however know if this helps or not. Never tried what you
> need.
>
> There is to my knowledge no way to convert from the binary "Save
> key" format to anything else. That format also contains registry
> ACLs and can only overwrite/replace (not merge) in any case. If you
> cannot "restore" over the existing key, I don't know what else to
> recommend. Just to check, you are focusing _on_ the \Classes\ key
> and selecting to "Restore..."?


Mark, I thought of that same idea you suggested, but I'm afraid to follow
thru with it all the way until I learn a little bit more about it.

When regedit sees the imported Classes key (loaded by regedt32), of course
that key is in the wrong location; it's adjacent to the root key HKLM
instead of being nested inside HKLM/Software. So my question is when you use
regedit to Export Registry File, does it see the selected key from the
"bottom-up" or from the "top-down". If it exports the key top-down then it
will be incorrect because the key Software will be missing. However, if it
exports bottom-up then it will be perfect, as then it will keep the HKLM key
out of the file.

Knack (Al D.)



 
Reply With Quote
 
Knack
Guest
Posts: n/a
 
      3rd Nov 2003

"Mark V" <(E-Mail Removed)> wrote in message
news:Xns9427CFD1171DEz9zzaQ2btw@207.46.248.16...
> In microsoft.public.win2000.registry Al Dubovick wrote:
>
> > Many file associations are lost. Need to replace the entire subkey
> > HKLM\Software\Classes with another previously saved subkey. The
> > replacement was saved via Save Key from a backed up hive that was
> > previously loaded and unloaded in regedt32. Although I'm Admin,
> > regedt32 is not giving me privilege to do Registry > Restore on
> > the Classes subkey with the previously saved replacement.
> >
> > Note that Load Hive is unavailable on selected subkeys; you can do
> > it only at the root of the HKLM tree.
> >
> > So my workaround idea is to try to convert the extensionless
> > subkey file (Classes) into a .reg file and then import it. Is
> > there a way to convert a registry file into registry script file
> > (.reg)? Note that I tried simply putting a .reg extension on the
> > Classes file, but when I double-click on it a popup error states
> > that it's not registry script. I've also tried opening the
> > extensionless Classes file with Notepad via Open With, but the
> > Notepad window doesn't show registry script.

>
> One thought. Can you load that saved hive file into regedt32 again?
> If so, you can then start regedit and see the "loaded hive" (and
> export). Close regedit, unload hive, close regedt32.
>
> I do not however know if this helps or not. Never tried what you
> need.
>
> There is to my knowledge no way to convert from the binary "Save
> key" format to anything else. That format also contains registry
> ACLs and can only overwrite/replace (not merge) in any case. If you
> cannot "restore" over the existing key, I don't know what else to
> recommend. Just to check, you are focusing _on_ the \Classes\ key
> and selecting to "Restore..."?


Mark, I thought of that same idea you suggested, but I'm afraid to follow
thru with it all the way until I learn a little bit more about it.

When regedit sees the imported Classes key (loaded by regedt32), of course
that key is in the wrong location; it's adjacent to the root key HKLM
instead of being nested inside HKLM/Software. So my question is when you use
regedit to Export Registry File, does it see the selected key from the
"bottom-up" or from the "top-down". If it exports the key top-down then it
will be incorrect because the key Software will be missing. However, if it
exports bottom-up then it will be perfect, as then it will keep the HKLM key
out of the file.

Knack (Al D.)



 
Reply With Quote
 
Mark V
Guest
Posts: n/a
 
      3rd Nov 2003
In microsoft.public.win2000.registry Al Dubovick wrote:

> Many file associations are lost. Need to replace the entire subkey
> HKLM\Software\Classes with another previously saved subkey. The
> replacement was saved via Save Key from a backed up hive that was
> previously loaded and unloaded in regedt32. Although I'm Admin,
> regedt32 is not giving me privilege to do Registry > Restore on
> the Classes subkey with the previously saved replacement.
>
> Note that Load Hive is unavailable on selected subkeys; you can do
> it only at the root of the HKLM tree.
>
> So my workaround idea is to try to convert the extensionless
> subkey file (Classes) into a .reg file and then import it. Is
> there a way to convert a registry file into registry script file
> (.reg)? Note that I tried simply putting a .reg extension on the
> Classes file, but when I double-click on it a popup error states
> that it's not registry script. I've also tried opening the
> extensionless Classes file with Notepad via Open With, but the
> Notepad window doesn't show registry script.


One thought. Can you load that saved hive file into regedt32 again?
If so, you can then start regedit and see the "loaded hive" (and
export). Close regedit, unload hive, close regedt32.

I do not however know if this helps or not. Never tried what you
need.

There is to my knowledge no way to convert from the binary "Save
key" format to anything else. That format also contains registry
ACLs and can only overwrite/replace (not merge) in any case. If you
cannot "restore" over the existing key, I don't know what else to
recommend. Just to check, you are focusing _on_ the \Classes\ key
and selecting to "Restore..."?



 
Reply With Quote
 
Mark V
Guest
Posts: n/a
 
      3rd Nov 2003
In microsoft.public.win2000.registry Al Dubovick wrote:

> Many file associations are lost. Need to replace the entire subkey
> HKLM\Software\Classes with another previously saved subkey. The
> replacement was saved via Save Key from a backed up hive that was
> previously loaded and unloaded in regedt32. Although I'm Admin,
> regedt32 is not giving me privilege to do Registry > Restore on
> the Classes subkey with the previously saved replacement.
>
> Note that Load Hive is unavailable on selected subkeys; you can do
> it only at the root of the HKLM tree.
>
> So my workaround idea is to try to convert the extensionless
> subkey file (Classes) into a .reg file and then import it. Is
> there a way to convert a registry file into registry script file
> (.reg)? Note that I tried simply putting a .reg extension on the
> Classes file, but when I double-click on it a popup error states
> that it's not registry script. I've also tried opening the
> extensionless Classes file with Notepad via Open With, but the
> Notepad window doesn't show registry script.


One thought. Can you load that saved hive file into regedt32 again?
If so, you can then start regedit and see the "loaded hive" (and
export). Close regedit, unload hive, close regedt32.

I do not however know if this helps or not. Never tried what you
need.

There is to my knowledge no way to convert from the binary "Save
key" format to anything else. That format also contains registry
ACLs and can only overwrite/replace (not merge) in any case. If you
cannot "restore" over the existing key, I don't know what else to
recommend. Just to check, you are focusing _on_ the \Classes\ key
and selecting to "Restore..."?



 
Reply With Quote
 
Mark V
Guest
Posts: n/a
 
      3rd Nov 2003
In microsoft.public.win2000.registry Knack wrote:

>
> "Mark V" <(E-Mail Removed)> wrote in message
> news:Xns9427CFD1171DEz9zzaQ2btw@207.46.248.16...
>> In microsoft.public.win2000.registry Al Dubovick wrote:
>>
>> > Many file associations are lost. Need to replace the entire
>> > subkey HKLM\Software\Classes with another previously saved
>> > subkey. The replacement was saved via Save Key from a backed up
>> > hive that was previously loaded and unloaded in regedt32.
>> > Although I'm Admin, regedt32 is not giving me privilege to do
>> > Registry > Restore on the Classes subkey with the previously
>> > saved replacement.
>> >
>> > Note that Load Hive is unavailable on selected subkeys; you can
>> > do it only at the root of the HKLM tree.
>> >
>> > So my workaround idea is to try to convert the extensionless
>> > subkey file (Classes) into a .reg file and then import it. Is
>> > there a way to convert a registry file into registry script
>> > file (.reg)? Note that I tried simply putting a .reg extension
>> > on the Classes file, but when I double-click on it a popup
>> > error states that it's not registry script. I've also tried
>> > opening the extensionless Classes file with Notepad via Open
>> > With, but the Notepad window doesn't show registry script.

>>
>> One thought. Can you load that saved hive file into regedt32
>> again? If so, you can then start regedit and see the "loaded
>> hive" (and export). Close regedit, unload hive, close regedt32.
>>
>> I do not however know if this helps or not. Never tried what you
>> need.
>>
>> There is to my knowledge no way to convert from the binary "Save
>> key" format to anything else. That format also contains registry
>> ACLs and can only overwrite/replace (not merge) in any case. If
>> you cannot "restore" over the existing key, I don't know what
>> else to recommend. Just to check, you are focusing _on_ the
>> \Classes\ key and selecting to "Restore..."?

>
> Mark, I thought of that same idea you suggested, but I'm afraid to
> follow thru with it all the way until I learn a little bit more
> about it.
>
> When regedit sees the imported Classes key (loaded by regedt32),
> of course that key is in the wrong location; it's adjacent to the
> root key HKLM instead of being nested inside HKLM/Software. So my
> question is when you use regedit to Export Registry File, does it
> see the selected key from the "bottom-up" or from the "top-down".
> If it exports the key top-down then it will be incorrect because
> the key Software will be missing. However, if it exports bottom-up
> then it will be perfect, as then it will keep the HKLM key out of
> the file.


I am uncertain in any case if you can in fact merge the entire HKLM
\Software\Classes\ into the registry. Never tried. There _could_ be
open handles in some keys that prevent it. I'd ensure a full
registry backup (ntbackup.exe, ERD (With "Also backup..." checked))
in advance for possible use from Recovery Console if things go awry.

You are correct in that the exported (regedit) file, "Classes" will
contain incorrect paths. You would need to load the file in a text
editor and do a search & replace operation to correct that.

For example replacing
HKEY_LOCAL_MACHINE\<somename>\SOFTWARE\Classes
with
HKEY_LOCAL_MACHINE\SOFTWARE\Classes
prior to import.

This regedit export/import is structurally different than "Save
key"/"Restore..." in regedt32.

 
Reply With Quote
 
Mark V
Guest
Posts: n/a
 
      3rd Nov 2003
In microsoft.public.win2000.registry Knack wrote:

>
> "Mark V" <(E-Mail Removed)> wrote in message
> news:Xns9427CFD1171DEz9zzaQ2btw@207.46.248.16...
>> In microsoft.public.win2000.registry Al Dubovick wrote:
>>
>> > Many file associations are lost. Need to replace the entire
>> > subkey HKLM\Software\Classes with another previously saved
>> > subkey. The replacement was saved via Save Key from a backed up
>> > hive that was previously loaded and unloaded in regedt32.
>> > Although I'm Admin, regedt32 is not giving me privilege to do
>> > Registry > Restore on the Classes subkey with the previously
>> > saved replacement.
>> >
>> > Note that Load Hive is unavailable on selected subkeys; you can
>> > do it only at the root of the HKLM tree.
>> >
>> > So my workaround idea is to try to convert the extensionless
>> > subkey file (Classes) into a .reg file and then import it. Is
>> > there a way to convert a registry file into registry script
>> > file (.reg)? Note that I tried simply putting a .reg extension
>> > on the Classes file, but when I double-click on it a popup
>> > error states that it's not registry script. I've also tried
>> > opening the extensionless Classes file with Notepad via Open
>> > With, but the Notepad window doesn't show registry script.

>>
>> One thought. Can you load that saved hive file into regedt32
>> again? If so, you can then start regedit and see the "loaded
>> hive" (and export). Close regedit, unload hive, close regedt32.
>>
>> I do not however know if this helps or not. Never tried what you
>> need.
>>
>> There is to my knowledge no way to convert from the binary "Save
>> key" format to anything else. That format also contains registry
>> ACLs and can only overwrite/replace (not merge) in any case. If
>> you cannot "restore" over the existing key, I don't know what
>> else to recommend. Just to check, you are focusing _on_ the
>> \Classes\ key and selecting to "Restore..."?

>
> Mark, I thought of that same idea you suggested, but I'm afraid to
> follow thru with it all the way until I learn a little bit more
> about it.
>
> When regedit sees the imported Classes key (loaded by regedt32),
> of course that key is in the wrong location; it's adjacent to the
> root key HKLM instead of being nested inside HKLM/Software. So my
> question is when you use regedit to Export Registry File, does it
> see the selected key from the "bottom-up" or from the "top-down".
> If it exports the key top-down then it will be incorrect because
> the key Software will be missing. However, if it exports bottom-up
> then it will be perfect, as then it will keep the HKLM key out of
> the file.


I am uncertain in any case if you can in fact merge the entire HKLM
\Software\Classes\ into the registry. Never tried. There _could_ be
open handles in some keys that prevent it. I'd ensure a full
registry backup (ntbackup.exe, ERD (With "Also backup..." checked))
in advance for possible use from Recovery Console if things go awry.

You are correct in that the exported (regedit) file, "Classes" will
contain incorrect paths. You would need to load the file in a text
editor and do a search & replace operation to correct that.

For example replacing
HKEY_LOCAL_MACHINE\<somename>\SOFTWARE\Classes
with
HKEY_LOCAL_MACHINE\SOFTWARE\Classes
prior to import.

This regedit export/import is structurally different than "Save
key"/"Restore..." in regedt32.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(Registry File Failure) Cannot load hive file Microsoft Windows 2000 Registry Archive 8 5th Aug 2004 02:19 PM
(Registry File Failure) Cannot load hive file Microsoft Windows 2000 Registry 4 5th Aug 2004 02:19 PM
(Registry File Failure) Cannot load hive file Microsoft Windows 2000 Registry Archive 0 4th Aug 2004 01:04 AM
Convert hive file into .reg file? Al Dubovick Microsoft Windows 2000 Registry 3 3rd Nov 2003 04:06 PM
Convert hive file into .reg file? Al Dubovick Microsoft Windows 2000 Registry Archive 0 2nd Nov 2003 06:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:45 PM.