Delete reg key

  • Thread starter Thread starter Steven Wong
  • Start date Start date
S

Steven Wong

Hi all,

How to delete registry keys without user intervention ?
like suppress the pop-up of the OK button or write some script
to delete the reg keys in the backgroup.
Thanks

Steven
 
If you want to remove a key and all it's underlying values then you'll need
to construct your .reg file with a - minus sign in front of the key you want
to remove.

An example file to remove a file association .zzz from HKCR
-----------------Begin File-----------
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\.zzz]
----------------End File-------------

(note the minus sign in front of HKEY)


If you need to delete only certain values, for example the string value
"InfoTip"="Contains zzz files"

Then put a minus sign after the equals sign without "quotes", something like
"InfoTip"=-

So your .reg file would look like
----------------Begin File------------
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.zzz]
"InfoTip"=-
----------------End File-------------

regedit /s filename.reg to import silently


--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| Hi all,
|
| How to delete registry keys without user intervention ?
| like suppress the pop-up of the OK button or write some script
| to delete the reg keys in the backgroup.
| Thanks
|
| Steven
|
|
 
Back
Top