October 27, 2004

Scripting Registry Key Deletions

Cool tip on how to script registry key deletions ..

One of my colleagues (who wishes to remain
anonymous) gave me a great tip this morning - how to delete registry keys and values
using a .REG file.

To delete a value, set its contents to - in the .REG file, e.g.

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\MyKey]

“MyValue”=-

Or to delete a key, add a - sign after the leading [ in the .REG file, e.g. [-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\MyKey]

Apparently this works on all version of Windows from Windows 2000 onwards, although
I’ve only tried it with Windows XP Professional.

[Mark's
(we)Blog]

Comment Below ↓

There are no comments yet, be the first!

Leave a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Media Corner

2

3

4

5

6

  • Gadget Corner

  • Entrecard

  • EntreDroppers

  • Linkage

  • Networking