RegDelete Partial KeyName

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
julesverne
Posts: 42
Joined: 18 Apr 2017, 14:39
Contact:

RegDelete Partial KeyName

15 Aug 2019, 03:21

RegDelete Docs mentions under the parameter:
ValueName

The name of the value to delete. If omitted, the entire KeyName will be deleted. To delete KeyName's default value -- which is the value displayed as "(Default)" by RegEdit -- use the phrase AHK_DEFAULT for this parameter.
I'm particularly interested in "If omitted, the entire KeyName will be deleted." I want to clearly understand what that means.

So below I have as an example:

Code: Select all

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HomeFolderDesktop\NameSpace\DelegateFolders\{3936E9E4-D92C-4EEE-A85A-BC16D5EA0819}
so am I to understand the entire path will be deleted rather than just {3936E9E4-D92C-4EEE-A85A-BC16D5EA0819} ?

If this is true, can the documentation be updated to be clearer? Perhaps with an example, so as not to have someone accidentally delete the entire path, when all they wanted was to delete the last "folder" (in this example {3936E9E4-D92C-4EEE-A85A-BC16D5EA0819}) and all it's contents.

Also, if this is true, perhaps a suggestion that as a workaround in the examples, creating a .reg file that can be run from ahk, because the code below will work to delete only the "{3936E9E4-D92C-4EEE-A85A-BC16D5EA0819} in my example above" along with all string, binary or Dword values in that key. A good reference to this is https ss64.com /nt/regedit.html Broken Link for safety under the "Delete keys and values from the registry:" section, which has this:
Delete keys and values from the registry:

Create a reg file like this, notice the hyphen inside the first bracket

Code: Select all

    Windows Registry Editor Version 5.00 
    [-HKEY_CURRENT_USER\SomeKey]
When double clicking this .reg file the key "SomeKey" will be deleted along with all string, binary or Dword values in that key.

If you want to just delete values, leaving the key in place, set the value you want to delete = to a hyphen
e.g.

Code: Select all

    Windows Registry Editor Version 5.00 
    [HKEY_CURRENT_USER\SomeKey]
    "SomeStringValue"=-
Again double click this .reg file to delete the values, or type REGEDIT /s MyFile.REG
Thanks for your help! Jules
julesverne
Posts: 42
Joined: 18 Apr 2017, 14:39
Contact:

Re: RegDelete Partial KeyName

15 Aug 2019, 22:58

I did a test myself to find the answer. For posterity I'm leaving it here.

I created a reg key called

Code: Select all

HKEY_CURRENT_USER\A_Test\A_SubfolderTest\A_SecondTierSubfolder
I then used RegDelete like so:

Code: Select all

RegDelete, HKEY_CURRENT_USER\A_Test\A_SubfolderTest\A_SecondTierSubfolder
And it deleted only the last folder (key) of the full path so in the example above that would be "A_SecondTierSubfolder" and all of it's values and Names inside of it.
user549
Posts: 7
Joined: 23 Jan 2019, 04:30

Re: RegDelete Partial KeyName

28 Aug 2019, 06:16

I am on Windows 10 64 bit. I can't delete this registry key though i can manually delete it using Regedit.exe

Code: Select all

RegDelete, HKEY_CLASSES_ROOT\GQSXf, f1gr
Please help. Thanks.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], RandomBoy, Rohwedder, ruespe and 377 guests