ter-pierre Posted October 21, 2004 Share Posted October 21, 2004 Hi Any one knows a way to search in registry a key, and, if found, delete? tks Pierre Link to comment Share on other sites More sharing options...
Nova Posted October 21, 2004 Share Posted October 21, 2004 (edited) The following code will check to see if a named key exists in the registry and if it is found to exist then it is deleted. RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "Key") If @error = 0 Then RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "Key") Else ;Whatever EndIf Is that what you wanted ? Your question wasnt really worded all that particularly well. Edited October 21, 2004 by nova Link to comment Share on other sites More sharing options...
ter-pierre Posted October 21, 2004 Author Share Posted October 21, 2004 i find some think therehttp://www.autoitscript.com/forum/index.ph...wtopic=3746&hl=i need some thing like this:regfind(<regkey>,<text>)where: <regkey> = the root registry key to search from <text> = the patern to findthe result must be the name of the key where the text patern was fond.tksPierre Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted October 21, 2004 Share Posted October 21, 2004 (edited) Have you tried writing a function yet, or are you just begging for code? Just as Larry said you will need to use RegEnumKey, RegEnumVal, and RegDelete. I would look at Larry's FileSearch as it will do things quite similar to what you are doing except it uses File* functions instead of registry... this makes it rather simple to tweak to what you need. I don't expect anyone to handout such a large function... if you want it done write it yourself and if you feel that it is useful then share it. It is pathetic how many people come out to these forums and expect everyone else to write them code... learn the language and do it yourself! *** Matt @ MPCS EDIT: It appears Holger has already provided you with a solution that will work... just encapsulate the code posted in that thread in a function and you will have what you are looking for. Edited October 21, 2004 by Matt @ MPCS Link to comment Share on other sites More sharing options...
ter-pierre Posted October 22, 2004 Author Share Posted October 22, 2004 I do not want that nobody writes my codes! I just have made a question! Perhaps somebody already had solved this problem. I think that also for this it serves a forum! Pierre 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