Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Registry Tree Import/Export - Please help.

2 views
Skip to first unread message

guy

unread,
Jun 17, 2003, 3:57:09 AM6/17/03
to
Thanks Alan... but I guess I left out one key word: "Programatically." I
needed to do it programatically as an automatic process when people update
from an older version of my program.

Basically, though, I did as you suggested with a couple twists. For the
benefit of the group:

I exported the tree using RegExpo (A unit I found on the web by Arthur
Hoornweg (arthur....@email.de)).

Then I loaded the file ino a StringList and did the searching and replacing
I needed.

Then I shelled out to Regedit to do the import part... finding the command
line option ('/s') for that was also a pain in the tukus. I did not use
Regedit for the export, because for some evil reason only known to MfS, in
win2k Regedit does not export the nice text files that we know and love (at
least not using the '/e' parameter)... it seems to export one of those
useless binary 'hive' files that I had so much trouble with.

Anyway, it all works like a champ now... unless, of course, you are on NT/2k
and you are not an administrator. I can live with that for the moment, but
I really need to find a registry permissions tweaker for D4, so that I can
open up my branch under HKEY_LOCAL_MACHINE\Software\ to all users. ... and
again, I really want to do it programatically.

Any help on THAT front will be appreciated! Thanks.

-John

AlanGLLoyd wrote:
>
> In article <3D53E6C8...@xx.com>, jph <x...@xx.com> writes:
>
> >I need to move a Registry key and its sub-keys from
> >HKEY_CURRENT_USER\Software\xxx to HKEY_LOCAL_MACHINE\Software\yyy
> >
>
> Entirely your own repsonsibility, back up your User???.dat and
System???.dat
> files before doing anything.
>
> Open RegEdit
>
> Select HKCU\Software\xxx
>
> Choose Registry | Export Registry File ...
> ..and give it SomeName.reg
>
> Open the file in Wordpad and replace every occurrence of HKCU with HKLM
(the
> full names I mean, not my abbreviation.) DON'T CHANGE ANYTHING ELSE.
>
> Save the file as a text file (or just save it).
>
> Double click on the file, and confirm its message - It should then say its
been
> successful.
>
> Go into RegEdit and select HKLM\Software\xxx and delete the key.
>
> That's it.
>
> Alan Lloyd
> alang...@aol.com


AlanGLLoyd

unread,
Jun 17, 2003, 3:43:42 PM6/17/03
to
In article <pRzHa.700$yJ....@nwrdny03.gnilink.net>, "guy" <g...@fart.net>
writes:

>Thanks Alan... but I guess I left out one key word: "Programatically." I
>needed to do it programatically as an automatic process when people update
>from an older version of my program.
>

I've had a real good clear-out of my NG postings and cannot remember what you
were trying to do. Perhaps you could email me with details.

I've had no trouble accessing NT & 2K registry with the standard D3
Registry.pas which has the desired security access changed for NT as follows in
Create ...

constructor TRegistry.Create;
var
OSVersionInfo : TOSVersionInfo;
begin
RootKey := HKEY_CURRENT_USER;
OSVersionInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
GetVersionEx(OSVersionInfo);
if OSVersionInfo.dwPlatformId = VER_PLATFORM_WIN32_NT then
DesiredSAM := MAXIMUM_ALLOWED
else
DesiredSAM := KEY_ALL_ACCESS;
LazyWrite := True;
end;

... and then every mention of KEY_ALL_ACCESS i any API was changed to
DesiredSAM. I then renamed the .pas to NTRegistry and used that. Then accessed
the registry in the normal way.

What version of Delphi are you using.

Alan Lloyd
alang...@aol.com

0 new messages