10 pts.
 Need help editing a code (WMI)
This here is my current WMI code I'm using in a ConsoleApplication1.exe:
[code]Dim wmiServices = GetObject("winmgmts:root/default")
        Dim colTreeChanges = wmiServices.ExecNotificationQuery _
            ("SELECT * FROM RegistryTreeChangeEvent " _
            & "WHERE Hive='HKEY_LOCAL_MACHINE' " _
            & "AND RootPath='SOFTWARE\Microsoft'")
        While (True)
            Dim TreeChange = colTreeChanges.NextEvent
            TreeChange.GetObjectText_()
            Console.Write("Hive = " & TreeChange.Hive & vbNewLine _
               & "RootPath = " & TreeChange.RootPath _
               & TreeChange.GetObjectText_())
        End While
[/code]
This code helps detect all the changes inside the registry tree to monitor the installation of all programs. This is for a school project and I'm COMPLETELY NEW to Windows Management Instrumentation.
What I need to do now is the following:
1) Edit the code such that it only detects one instance of the output.
2) Also change the output such that it also shows the name of the program installed.
I already know how to redirect the output into the event viewer, but if anyone knows how to do the above, PLEASE help me. I only have about 4 weeks left till the end of this final year project.


Software/Hardware used:
Visual Studio 2008
ASKED: July 20, 2010  2:30 AM
UPDATED: July 20, 2010  1:17 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _