Score:0

Is there a way to restore a backed up .reg while deleting added keys, not just overwrite existing keys?

cn flag

I want do an export of the current state of the following path:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters

And so I can do that with:

reg export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters C:\test.reg /y

What I would like is to perform a restore with that .reg but not just fix/overwrite existing keys, I also need to delete anything that may have been added so that it's a true return to the original state.

Is there a simple way to do this?

Thanks!

Score:1
cn flag

As you only have one key tree, add the following line in the reg file before any other keys:

[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters]

It will delete the top-level key before importing.

https://support.microsoft.com/en-us/topic/how-to-add-modify-or-delete-registry-subkeys-and-values-by-using-a-reg-file-9c7f37cf-a5e9-e1cd-c4fa-2a26218a1a23

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.