hi,

I have to search for particular registry & if it is there then i need to delete it...

How do i go about it?

Thanks
skj
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
Is this a static registry key?
Answered 08/31/2005 by: brenthunter2005
Fifth Degree Brown Belt

Please log in to comment
0
Batch?
VBScript?
JScript?
MSI?
C#?
Manually with regedit?
Answered 08/31/2005 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
Yes its a static registry key ... i need to search for it & if it is there its needs to be deleted and if it is not there a file has to b added
Answered 08/31/2005 by: skj
Second Degree Brown Belt

Please log in to comment
0
I'm still not 100% sure what you require yet.

Can the regkey be found anywhere in the registry, or is it a full key such as HKLM\Software\Application\SomeValue?

Because if it is a full key, (in all MSI) you could do an AppSearch for the regkey (to tell you if it already exists or not), and then within the Registry table delete the required key, and then condition your file component to only install locally if the AppSearch is met. It might sound like a complicated way to do it, but this is all in pure MSI.

Another way, of course, would be to have a custom action (in VBScript etc) that checks for this key and then does the filecopy or filerename etc...

I'm sure WiseUser will have another method too! [:D]
Answered 08/31/2005 by: brenthunter2005
Fifth Degree Brown Belt

Please log in to comment
0
OK...

1) Run "regedit.exe".
2) Select "edit\find" and type in the string you would like to search for (or navigate to the key if you feel up to it).
3) Once you've found it, press the delete button (sometimes called "Del").
4) Confirm by clicking "Yes" (or "Ja", "Oui", "Si", etc.)
5) Close regedit.

Hope this helps.[;)]

I'm sure WiseUser will have another method too!

I can't believe you didn't think of this too Brent![:D]
Answered 08/31/2005 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
can anyone give me a vbscript for this situation?

thanks
skj
Answered 08/31/2005 by: skj
Second Degree Brown Belt

Please log in to comment
0
SKJ,

Which situation would you like a script for? If you ask your questions clearly, and include as much information as possible, then people can help you much more quickly. Its possible English may not be your first language, but don't worry about grammatical/spelling errors, so long as we understand what you want.

As Brent asked you, is the key anywhere in the registry or a full key? Why don't you use AppSearch for it, that would be much easier?

It sounds like you are using a registry key as a flag to install a file? Am I correct?

Rgds

Paul
Answered 08/31/2005 by: plangton
Second Degree Blue Belt

Please log in to comment
0
Hi Skj:

Try to post as much information as you can so we can easily provide you with the solution otherwise we can not simply post vbscripts or any other scripts that will delete your whole registry tree and will *(!@)() the system. So post as much relevant information as you can.
Answered 08/31/2005 by: wiseapp
Second Degree Green Belt

Please log in to comment
0
Thanks for the clarification guys![;)]

Skj, there are plenty of guys here with the knowledge and will to help you... but why should they wate their time if you can't be bothered to explain your problem clearly?

Brent's solution above (post 5) was probably the best (MSI) way of dealing with your situation (assuming I've understood it) - just one amendment to make... I this Brent might have meant the "RemoveRegistry" table?
Answered 09/01/2005 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
Sorry for not providing details information...

HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Sybase_ASE_ODBC_Driver
the situation is if this registry is present i need to delete it and add a .txt file saying its deleted & if it is not present i need to add a file saying its fixed.

hope this clarifies ur doubt.. now i need a vbscript or anyother ways of dealing with this issue?

thanks very much for ur patient & time
skj
Answered 09/01/2005 by: skj
Second Degree Brown Belt

Please log in to comment
0
If you use appsearch you can set a property value based on whether or not the reg key is found. You can then condition component/s installing the file and removing the reg key using the property value set during appsearch.


Regards,
Rob.
Answered 09/01/2005 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
On Error Resume Next

Const sKEY = "HKLM\SOFTWARE\ODBC\ODBCINST.INI\Sybase_ASE_ODBC_Driver\"

Set oWsh = CreateObject("Wscript.Shell")

Set oFso = CreateObject("Scripting.FileSystemObject")

sLogFile = "C:\Windows\Temp\MyLogFile.log"

Set hLogFile = oFso.OpenTextFile(sLogFile, 2, True)


sVal = oWsh.RegRead(sKEY & "Driver")

If sVal = "" Then

hLogFile.WriteLine "Fixed"

Else

oWsh.RegDelete sKEY
hLogFile.WriteLine "Deleted"

End If

hLogFile.Close

Set hLogFile = Nothing

oWsh.Run "%SystemRoot%\Notepad.exe " & sLogFile, 5, False

Set oWsh = Nothing

Set oFso = Nothing
Answered 09/01/2005 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
0
You are too kind [;)]
Answered 09/01/2005 by: MSIPackager
Third Degree Black Belt

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