0

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!

evenyougreg
  • 85
  • 1
  • 6

1 Answers1

1

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

Greg Askew
  • 35,880
  • 5
  • 54
  • 82