How can I rename key (or subkey) in windows registry?
Printable View
How can I rename key (or subkey) in windows registry?
Just pay attention!
I don´t understand wy would you like to do that, but
this is the way to do it:
-First launch the Regedit.exe app
-Find the key or subkey that you want to rename
-And now press the right button on the mouse "right click" (just to be sure)
and then choose rename and
-Now type the new desired name for the key or subkey
-To finish:
->Start praying that you don´t just rename something that for
recovering you'll have to reinstall your Operating System.;)
Saludos...;)
I mean by VB.
Copy the key with all contents to new name and delete old ones (if there's no renaming way).
I try to do by using RegSave and RegRestoreKey
Private Sub SaveKey_Click()
Dim C As SECURITY_ATTRIBUTES
Dim Dummy
Dim Y As Long
Y = GetSubkeyHandle(txtSectionName.Text)
Dummy = RegSaveKey(Y, "a:\TryReg", C)
' It should be A:\TryReg.reg ' ?
MsgBox CStr(Dummy) ' It return &H0, is it work?
End Sub
this sub work but I don't know how to use RegRestoreKey or I should use RegReplaceKey ?