05-12-2019, 03:35 AM
Function RenameRegistryKey
;/
function $parentKey $oldName $newName [hive]
;Renames a registry key.
;Error if failed.
;parentKey, hive - parent key and hive, like with <help>rget</help>.
;;;If parentKey is "", uses hive as key handle.
;oldName, newName - old and new name of the subkey.
;EXAMPLE
;RenameRegistryKey "Software\Gindi\QM2\User" "KD" "KE"
dll advapi32 #RegRenameKey hKey @*lpSubKeyName @*lpNewKeyName ;;undocumented API
RegKey k
if(!k.Open(parentKey)) end "failed to open parent key"
if(RegRenameKey(k @oldName @newName)) end "failed to rename"