Need help editing a code (WMI)

10 pts.
Tags:
Console application
Programming Languages
Visual Studio 2008
Windows Management Instrumentation
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

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following