/build/static/layout/Breadcrumb_cap_w.png

How to delete Registry Key value using VBScript

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

Answers (4)

Posted by: mahendraKumar 12 years ago
Senior Yellow Belt
1
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"
Posted by: anonymous_9363 12 years ago
Red Belt
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.
Posted by: mahendraKumar 12 years ago
Senior Yellow Belt
0
Ok ... Here you go

http://itninja.com/question/require-help-in-deleting-registry-value&mpage=1&key=𕉽
Posted by: marksmith15 12 years ago
Senior Yellow Belt
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
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ