hallo,
hab noch etwas änderung an der sub vorgenommen:
(einfach austauschen)
Sub searchInRegistry(ByVal l As ListBox, ByVal searchString As String, _
ByVal exportPath As String, ByVal filter As Boolean, _
ByVal startfile As Boolean)
Dim sr As IO.StreamReader
Dim str As String
Dim p1, p2 As Integer
Dim path As String
searchString = LCase(searchString)
If Not IO.File.Exists(exportPath) Then
MsgBox("exportiere die registry .. kann eine oder mehr sekunde(n)" & _
"dauern .. ")
Application.DoEvents()
Shell("regedit.exe /e " & exportPath, AppWinStyle.Hide, True)
MsgBox("exportiert in die datei " & exportPath & " abgeschlossen !" & _
"suche jetzt nach " & searchString & "..")
End If
sr = New IO.StreamReader(exportPath)
sr.ReadLine()
Do While sr.Peek() >= 0
str = sr.ReadLine() : str = Trim(str) : str = LCase(str)
If InStr(str, searchString, CompareMethod.Text) Then
If filter = True Then
If str <> vbNullString Then
str = (Replace(str, "[", ""))
str = (Replace(str, "]", ""))
str = (Replace(str, "\\", "\"))
str = (Replace(str, Environment.NewLine, ""))
p1 = InStr(str, Chr(34))
p2 = InStr(p1 + 1, str, Chr(34))
If ((((p1 And p2) > 0)) And InStr(str, searchString, _
CompareMethod.Text)) Then
l.Items.Add(Mid(str, p1 + 1, (p2 - p1) - 1))
If (startfile = True) Then
path = Trim(Mid(str, p1 + 1, (p2 - p1) - 1))
path = Mid(path, 1, InStr(path, ".exe") + 4)
If ((IO.File.Exists(path)) And (Not _
IO.Directory.Exists(path))) Then
If (MsgBox(searchString & " wurde gefunden!" & _
"jetzt starten?", MsgBoxStyle.YesNo Or _
MsgBoxStyle.Information) = _
MsgBoxResult.Yes) Then
Process.Start(path)
End If
Exit Sub
End If
End If
End If
End If
ElseIf filter = False Then
l.Items.Add(str)
End If
End If
Loop
sr.Close()
End Sub gruss w|m |