Discussion Locked

How to delete a "VALUE" in registry?

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Say I am doing my own .reg file, I delete a "KEY" by doing this:
----------------------------------------
REGEDIT4

[-HKEY_CURRENT_USER\Software\Microsoft
\Windows\CurrentVersion\Policies]
----- (IN ONE LINE, OF COURSE) ----------

Run this reg file it will delete the whole key of "Policies"

Can somebody tell me how to delete a single VALUE which is under certain key name?

Is there any difference if the value is String, Binary, or DWORD type?

Or the delete command only depends on the value name?

Thanks for replying.

3 replies

by beermonster

Reg files are great for dumping and adding keys or values, but for deletion I would use either (for NT4) reg from the reskit, or a vbscript (nt4, win2k)such as

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.RegDel("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoAdminLogon")
set WshShell= nothing

change the key specified to the one you need to delete, save it in a file named yourfilename.vbs and run it.
The type of the value (string, dword etc) is irrelevant.

This discussion is closed to new replies.