Dave in PNG Posted October 27, 2006 Share Posted October 27, 2006 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 More sharing options...
cppman Posted October 27, 2006 Share Posted October 27, 2006 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.htm3).Then whenever you need to "restore" it, just double click that registry file. Miva OS Project Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted October 27, 2006 Share Posted October 27, 2006 i do believe check the scripts and scrapts for a registry to autoit i think i remember seein one in there Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 27, 2006 Moderators Share Posted October 27, 2006 i do believe check the scripts and scrapts for a registry to autoit i think i remember seein one in thereI 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 More sharing options...
Dave in PNG Posted October 27, 2006 Author Share Posted October 27, 2006 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 More sharing options...
jonesy Posted October 30, 2006 Share Posted October 30, 2006 (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 October 30, 2006 by jonesy Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now