Question

Locked

Automate registry key removal

By mssd ·
I am trying to find out if there is a way to remove registry keys automatically Example being if i have a list of keys and locations in a correct path to key HKEY_LOCAL_MACHINE\SOFTWARE\Apple Computer, Inc.\iTunes like the lists created from registry monitoring software can i automate the removal of thousands of keys in a script. any help would be greatly appreciated

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Take care and use this as an example

by Jacky Howe In reply to Automate registry key rem ...

The contents that could be saved as del.reg in the root directory c>

Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\SOFTWARE\Apple Computer, Inc.\iTunes]


This would delete the key iTunes and any keys below it.

The contents that could be saved as add.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Apple Computer, Inc.\iTunes]


This will add the iTunes key back to the registry. It will not add what was deleted from underneath it.


This is how the batch file is structured EXAMPLE:

@echo on
C: regedit /s del.reg
goto s2

:S2
C: regedit /s add.reg

goto end

:END

OR as a stand alone batch file.

@echo on
C:
REG DELETE HKEY_LOCAL_MACHINE\SOFTWARE\Apple Computer, Inc.\iTunes

:: Deletes the registry key iTunes and its all subkeys and values
goto s2

:S2

REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Apple Computer, Inc.\iTunes

:: Will add the iTunes key back to the registry.
goto end

:END

Back to Windows Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums