Hi,
i want to delete specific value in the registry using VBScript
I can delete registry using the following script .

Set WshShell = WScript.CreateObject("WScript.shell")
KEY1 = "HKEY_CURRENT_USER\ENVIRONMENT\"
WshShell.RegDelete KEY1

But i want to delete a specific value in that Key

help needed.
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
wshshell.regdelete function ... delete only reg key without sub keys...

HKCU\software\key1

but this will not be successive if there is some sub hives HKCU\Software\Key1\Subkey1

So you can instead use

WshShell.run "Reg Delete " & key1 & " /f"
Answered 01/30/2012 by: mahendraKumar
Senior Yellow Belt

Please log in to comment
0
The OP was asking about deleting a registry *value*, not a key or sub-keys.

@OP, is there some reason why you are unable to use a search engine? There must be millions upon millions of examples out there. My favourite VBScript reference source is devguru.com.
Answered 01/30/2012 by: VBScab
Red Belt

Please log in to comment
0
Ok ... Here you go

http://itninja.com/question/require-help-in-deleting-registry-value&mpage=1&key=𕉽
Answered 01/30/2012 by: mahendraKumar
Senior Yellow Belt

Please log in to comment
0
@ MK thank you, the script you gave in another forum also worked.
in the mean time i tried this non standard script and did the work for me.

dim wsh
set wsh = createobject("WScript.Shell")
wsh.run("REG.EXE DELETE ""HKEY_LOCAL_MACHINE\SYSTEM\ABC DEF\XYZ"" /v ABC_DEF /f")
set wsh = nothing
Answered 01/30/2012 by: marksmith15
Senior Yellow Belt

Please log in to comment
Answer this question or Comment on this question for clarity