On Error Resume Next
' Usage:
'
' bdr.vbs
' bdr.vbs Delphi\7.0
' bdr.vbs Delphi\5.0
'
' The optional 1st parameter identifies the registry key of your
' Delphi version. The default (= no parameter) is Delphi 8.
Const strBorland = "HKEY_CURRENT_USER\Software\Borland\{DelphiVer}"
Const strCP = "\Closed Projects"
Const strCF = "\Closed Files"
Dim strDelphiVer, strRegKey
If WScript.Arguments.Count = 0 Then
strDelphiVer = "
BDS\2.0"
Else
strDelphiVer = WScript.Arguments.Item(0)
End If
strRegKey = Replace(strBorland, "{DelphiVer}", strDelphiVer)
If MsgBox ("Delete all projects and files in """ & strRegKey & """?", vbYesNo) = vbYes Then
Dim Delphi
Set Delphi = CreateObject ("WScript.Shell")
Delphi.RegDelete strRegKey & strCP & "\"
Delphi.RegDelete strRegKey & strCF & "\"
End If