You are not logged in.
Hi guys, I want to delete all the subkeys of a key without deleteing the key itself.
The base key is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles
Within the above key there are multiple random GUID subkeys, different for every machine. As an example:
{962855D5-CD1C-46B1-A804-AF1EAC090198}
{A629C2AF-ABD7-4EF3-9CF5-C3B2677D6C1C}
I would like to remove all the subkeys from that base key above without deleting it.
Thank you.
Last edited by Eehixohw (19 Jun 2016 12:18)
Offline
Should be easy enough to adapt the code I posted on your recent topic about MS Office to that purpose.
https://ss64.org/viewtopic.php?id=2143
cmd | *sh | ruby | chef
Offline
for /f "usebackq tokens=*" %%a in (`reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles"`) do reg delete "%%a" /f
for /f "usebackq tokens=*" %%a in (`reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\Unmanaged"`) do reg delete "%%a" /f
Done! Thanks for the advice.
Offline