Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting a Registry Key?

Status
Not open for further replies.

aljubicic

Programmer
Nov 7, 2002
82
AU
Hi All,

How do I delete the registry key within vbscript?

My Computer\HKEY_CURRENT_USER\Software\ABBYY\FREngine\5.0\License

Name: Agreement
Type: REG_SZ
Data: IGMGBOGEBB....

What is ther function for this?


 
Try something like this:
Code:
Set Sh=WScript.CreateObject("WScript.Shell")
myKey="HKCU\Software\ABBYY\FREngine\5.0\License\"
WScript.Echo Sh.RegRead(myKey & "Agreement")
' to delete the name
Sh.RegDelete myKey & "Agreement"
' to delete the whole key
Sh.RegDelete myKey

Hope This Help
PH.
 
If I didn't want to delete the Agreement, but did want to delete the Data Value of the Agreement. How would this be done?
 
RegWrite instead of regdelete or regread, just write a "" to the value if you want to clear it
 
Try something like this:
Code:
Set Sh=WScript.CreateObject("WScript.Shell")
myKey="HKCU\Software\ABBYY\FREngine\5.0\License\"
Sh.RegWrite myKey & "Agreement","","REG_SZ"

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top