SaveSetting "Program Name", "Setting", "Option", Value
How can i delete everything from just knowing the "Program Name", like delete all the settings?
Printable View
SaveSetting "Program Name", "Setting", "Option", Value
How can i delete everything from just knowing the "Program Name", like delete all the settings?
Hai,
The following example delete "My Program" key and all the its values and data.
If you have subkeys under the main key, then you will have to remove it first as i remember. :DCode:Public Sub delUrlKey()
regkey = "Software"
lngresult = RegOpenKeyEx(HKEY_CURRENT_USER, regkey, 0&, keyallaccess, path)
If lngresult = 0 Then
lngresult = RegDeleteKey(path, "My Program")
RegCloseKey (path)
End If
End Sub
use deletesetting
Quote:
DeleteSetting Statement
Deletes a section or key setting from an application's entry in the Windowsregistry.
Syntax
DeleteSetting appname, section[, key]
The DeleteSetting statement syntax has thesenamed arguments:
Part Description
appname Required.String expression containing the name of the application orproject to which the section or key setting applies.
section Required. String expression containing the name of the section where the key setting is being deleted. If only appname and section are provided, the specified section is deleted along with all related key settings.
key Optional. String expression containing the name of the key setting being deleted.
Remarks
If allarguments are provided, the specified setting is deleted. A run-time error occurs if you attempt to use the DeleteSetting statement on a non-existent section or key setting.
If this is from your own program, or a program for which you know the appname and section, DeleteSetting will work. A lot of programs make an entry somewhere having noting to do with themselves, but keeping a record of installation date, so you can't run the program after the trial period expires, and you can't find the registry entry by the name of the program.Quote:
Originally Posted by Slyke
Also remember, SaveSetting and GetSetting will default to a specific location in the registry.
HKEY_CURRENT_USER\Software\VB and VBA Program Settings
So if you want to save it in LOCAL_MACHINE for example, you'd have to use another method.
My 2p worth. To delete a subkey and all contents including subkeys with no fuss, use the SHDeleteKey API.
Lol, i wasnt trying to crack programs, just wanted to do a "reset all options" for programs i made XD. I know they would'nt store trial periods in the same place as settings!
But thanks for the answers =D.