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
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)
Please log in to answer
Posted by:
skj
19 years ago
Posted by:
brenthunter2005
19 years ago
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]
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
19 years ago
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 can't believe you didn't think of this too Brent![:D]
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:
plangton
19 years ago
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
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
19 years ago
Posted by:
WiseUser
19 years ago
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?
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
19 years ago
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
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
19 years ago
Posted by:
WiseUser
19 years ago
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
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.