Jump to content

Exporting the Registry


Recommended Posts

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.

Link to comment
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.

Link to comment
Share on other sites

  • Moderators

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)

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.

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...