Hi Paul,
If I set the folowing registry key and value:
RegSetString("hkey_local_machine\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","something", "c:\\something.exe")
...how can I delete only the key called "something" with its value, not the whole "Run" tree?
This line:
DeleteRegKey("hkey_local_machine\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","something")
of course drops syntax error, but an extension for DeleteRegKey command, like:
DeleteRegKey("hkey_local_machine\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\something")
would be very useful.
Thanks you,
B.
			
			
			
				Your third choice should work,  have you tried it?
			
			
			
				Hi ,
Yes, I've just tried it again, it doesn't delete the values.
Bye,
B.
			
			
			
				I'll look into it.  Pretty sure I've used it before to delete the value.
Also you can't delete keys in HKLM unless your process has the rights to do so, meaning it has to be ran under an administrator account.
			
			
			
				
I created the key as admin, and would like to delete them as admin too.
...and the result is the same on my Win98 machine, creation is OK, deleting fails.
DeleteRegKey works fine, but it does more than I want to do :)
			
			
			
				Hi Guys...
have you considered copying the functions available in that old registry.inc source code file? It would be offly nice to be able to enumerate keys as well. 
			
			
			
				Quote from: Paul Turley on February 10, 2009, 08:42:24 AM
I'll look into it.  Pretty sure I've used it before to delete the value.
Also you can't delete keys in HKLM unless your process has the rights to do so, meaning it has to be ran under an administrator account.
I know this is an old thread but I problem with using the current version DELETEREGKEY function, and I am using the function to delete to some keys in HKLM. 
Example :
-------------
Result=DeleteRegKey("HKEY_LOCAL_MACHINE\SYSTEM\\CurrentControlSet\\Control\\LockKey") 
END
The above compiled exe work fine provided the Lockey is the only keyname with no subkey under it.
But if I have some subkeys under LockKey, the compiled exe deletion would failed.
Im running as admin user now.
Any idea why it failed? ???
I know I can use dos command like reg to do it, in ebasic like 
SYSTEM "reg.exe" , "DELETE HKLM\SYSTEM\CurrentControlSet\Control\LockKey /f" which work fine but I dislike th black dos prompt that was display in seconds when the this system command is run.
Anyway, I can use DeleteRegKey to do it?  ???
Thanks :)
			
 
			
			
				Shlwapi.dll implements this function:
Quote from: msdnDeletes a subkey and all its descendants. The function will remove the key and all of the key's values from the registry.
$use "shlwapi.lib"
declare import, SHDeleteKeyA(int hkey, string pszSubKey),int
SHDeleteKeyA(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\LockKey")Note: HKEY_LOCAL_MACHINE is a constant, defined as 0x80000002.
			
				Quote from: sapero on January 16, 2010, 11:48:54 AM
Shlwapi.dll implements this function:
Quote from: msdnDeletes a subkey and all its descendants. The function will remove the key and all of the key's values from the registry.
$use "shlwapi.lib"
declare import, SHDeleteKeyA(int hkey, string pszSubKey),int
SHDeleteKeyA(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\LockKey")
Note: HKEY_LOCAL_MACHINE is a constant, defined as 0x80000002.
Thanks alot  ;D
It work if I change this to
$use "shlwapi.lib"
declare import, SHDeleteKeyA(int hkey, string pszSubKey),int
SHDeleteKeyA(0x80000002, "SYSTEM\\CurrentControlSet\\Control\\LockKey") :D