Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Deleting a reg key with a .REG file

  • 14-05-2007 03:02PM
    #1
    Moderators, Arts Moderators Posts: 36,228 Mod ✭✭✭✭


    Adding a registry entry is easy enough, but how would I go abotu deleting a reg key using a .REG file? If I want to remove the keys in the following "folders", can I just enter some empty quotes or is there another method?

    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USER\Software\VB and VBA Program Settings\jetdComsrv\MyProgram]
    "1"="YT7STLL7TTA8T8V2"
    "4"="T9791JD83KEP89L3"
    "22"="YT7Y86V5C1BMWYR4"
    "24"="YJ7FHIS42T9RTQB5"

    [HKEY_LOCAL_MACHINE\SOFTWARE\MyPublisher\Licences]
    "1"="YT7STLL7TTA8T8V2"


Comments

  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    http://support.microsoft.com/kb/310516
    Deleting Registry Keys and Values
    To delete a registry key with a .reg file, put a hyphen (-) in front of the RegistryPath in the .reg file. For example, to delete the Test subkey from the following registry key:

    HKEY_LOCAL_MACHINE\Software

    put a hyphen in front of the following registry key in the .reg file:

    HKEY_LOCAL_MACHINE\Software\Test

    The following example has a .reg file that can perform this task.

    [-HKEY_LOCAL_MACHINE\Software\Test]

    To delete a registry value with a .reg file, put a hyphen (-) after the equals sign following the DataItemName in the .reg file. For example, to delete the TestValue registry value from the following registry key:

    HKEY_LOCAL_MACHINE\Software\Test

    put a hyphen after the "TestValue"= in the .reg file. The following example has a .reg file that can perform this task.

    HKEY_LOCAL_MACHINE\Software\Test
    "TestValue"=-


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 96,116 Mod ✭✭✭✭Capt'n Midnight


    you can also remove keys with reg.exe at the command prompt

    If the Windows Server 2003 Beta 3 version of the Administration Tools Pack is installed, follow these steps:

    reg delete HKEY_CLASSES_ROOT\RasDialin.UserAdminExt /f
    reg delete HKEY_CLASSES_ROOT\RasDialin.UserAdminExt.1 /f


  • Moderators, Arts Moderators Posts: 36,228 Mod ✭✭✭✭pickarooney


    Cheers lads!


Advertisement