Sign in to follow this  
Followers 0
Dave in PNG

Exporting the Registry

6 posts in this topic

I need to write a brute-force uninstaller for a particularly ill-behaved program. Because it makes over 50 registry entries, I'd like to export out the registry entries before I actually delete them so I have a "undo".

Rather than just call "reg.exe export" a bunch of times, is anyone aware of AutoIt code to read a registry entry and then create a text string that looks like a "reg export" result?

I could write something, but would rather not if it's already been done.

Thanks.

Share this post


Link to post
Share on other sites



Should'nt be too hard.

Look in the help file under RegEnumVal(), RegEnumKey(). Also, your going to need to know how to read/write files.

steps:

1).Get an array of all the keys, and values.

2).WRite a registry file. http://www.programmerworld.net/win/registry.htm

3).Then whenever you need to "restore" it, just double click that registry file.

Share this post


Link to post
Share on other sites

i do believe check the scripts and scrapts for a registry to autoit i think i remember seein one in there

Share this post


Link to post
Share on other sites

i do believe check the scripts and scrapts for a registry to autoit i think i remember seein one in there

I think Gary did one. (gafrost)

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Thanks for the suggestions, but I really didn't find anything useful without more work.

I decided to RegToScript. That way I can write out the AU3 code needed to recreate the keys I will be deleting. If the user runs the program again and it sees the undo files (containing AU3 code), it will then INCLUDE it and execute it.

Thanks again.

Dave

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

There is an undocumented switch with REGEDIT.EXE (on XP anyway, don't know about other OSs) that lets you export parts of the registry. Here is a working example:

regedit /e c:\regfile.txt "HKEY_LOCAL_MACHINE\Software\microsoft\windows\currentversion\uninstall"

Edited 'cos I kant shpell...

Edited by jonesy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0