Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Scripting Client Upgrades

RE: Scripting Client Upgrades

From: Branimir Petrovic <BranimirP_at_cpas.com>
Date: Tue, 6 Jul 2004 13:02:56 -0400
Message-ID: <33678E78A2DD4D418396703A750048D401024EA0@RIKER>

> Can you please share the experience how to delete Windows
> registry value
> (parameter) or even whole branch using scripting.
> Sorry for basic question.
> I know how make new entries in Win registry,
> even able to update, but there knowledge hole regarding deleting.

This small example is done in Windohs native scripting (abomination is better term) known as Visual Basic Script:

' ////////////////////////////////////////////////////////////////////
' FileName: DemoRmoveKey.vbs
' ////////////////////////////////////////////////////////////////////

Sub RemoveKey(gcsKeyToDelete)' removes passed registry key

    Dim oShell
    Set oShell = CreateObject("Wscript.Shell")     On Error Resume Next
    oShell.RegDelete gcsKeyToDelete
    If Err.Number Then

        MsgBox "Error # " & CStr(Err.Number) & " " & Err.Description     Else

        MsgBox "Removed registry key", vbInformation, gcsKeyToDelete     End If
End Sub

' Uncomment next line and kiss your ORACLE registry key good bye: 'CONST sKeyToRemove = "HKLM\SOFTWARE\ORACLE\"

' But this is OK to try since there is no such key in your registry, ' make it manually and see what happens: CONST sKeyToRemove =
"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\XYZ\"

RemoveKey sKeyToRemove

While removing known registy key is trivial, enumerating registry keys is not. You'd need to be familiar with another horrid object model - the notorious WMI to pull trick like this (straight from note 124353.1):

	3.g. Go to HKEY_CLASSES_ROOT, remove all keys that begin with 
		Ora or ORCL (e.g. Oracle..., ORADC..., ORAMMC..., OraOLE...,

		OraPerf... and ORCL...).

For kinky details on WMI have a look at: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnclinic/ht ml/scripting06112002.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/ wmi_start_page.asp

Another place to have a look at since you can get some working examples: http://www.microsoft.com/technet/community/scriptcenter/default.mspx

Forgetting about Winodohs natives, move to wonderful world of Python or Perl and be able to do more magic with lesser amount of effort and far less headaches...

Branimir



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Tue Jul 06 2004 - 12:00:12 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US