Forum Discussion

Yogesh_C's avatar
Yogesh_C
New Contributor
9 years ago

How to rename Registry (Subsection)?

A Section object is returned by the Registry method of the Storages object. https://support.smartbear.com/viewarticle/85046/   I understand how I can create/modify an 'Option' (using SetOption Met...
  • HKosova's avatar
    9 years ago

    The Storages object does not support renaming registry keys. You'll need to delete the old key and create a new one.

     

    A possible way is to shell out to reg.exe to copy the key recursively then delete the old key:

    // JScript / JavaScript
    var oShell = Sys.OleObject("WScript.Shell");
    oShell.Run("reg copy HKCU\\MyKey HKCU\\MyKey_old /s /f", 0, true);
    oShell.Run("reg delete HKCU\\MyKey /f", 0, true);