/build/static/layout/Breadcrumb_cap_w.png

Urgent

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

Answers (13)

Posted by: brenthunter2005 15 years ago
Fifth Degree Brown Belt
0
Is this a static registry key?
Posted by: WiseUser 15 years ago
Fourth Degree Brown Belt
0
Batch?
VBScript?
JScript?
MSI?
C#?
Manually with regedit?
Posted by: skj 15 years ago
Second Degree Brown Belt
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
Posted by: brenthunter2005 15 years ago
Fifth Degree Brown Belt
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]
Posted by: WiseUser 15 years ago
Fourth Degree Brown Belt
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]
Posted by: skj 15 years ago
Second Degree Brown Belt
0
can anyone give me a vbscript for this situation?

thanks
skj
Posted by: plangton 15 years ago
Second Degree Blue Belt
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
Posted by: wiseapp 15 years ago
Second Degree Green Belt
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.
Posted by: WiseUser 15 years ago
Fourth Degree Brown Belt
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?
Posted by: skj 15 years ago
Second Degree Brown Belt
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
Posted by: MSIPackager 15 years ago
3rd Degree Black Belt
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.
Posted by: WiseUser 15 years ago
Fourth Degree Brown Belt
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
Posted by: MSIPackager 15 years ago
3rd Degree Black Belt
0
You are too kind [;)]
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