Jump to content

Recommended Posts

Posted (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 by nova
Posted (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 by Matt @ MPCS
Posted

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

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
×
×
  • Create New...