Start/Stop windows service dependent on wmi

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pakmarshal
    New Member
    • Aug 2009
    • 17

    #1

    Start/Stop windows service dependent on wmi

    Hi,
    I have developed a windows service which records the applications (processes) that runs on the machine.

    To get the process start trigger i have used wmi.

    Code:
     Obj_ManagementStartWatcher = New ManagementEventWatcher("Select * From Win32_ProcessStartTrace")
      AddHandler mObj_ManagementStartWatcher.EventArrived, AddressOf Proces_Arrived
       Obj_ManagementStartWatcher.Start()
    what I have noticed that if my machine RAM is almost full. and at that time if i stop my service , then copy same exe (service exe) and paste it on the same location and start it again.
    My service stop recieve the triggers from wmi.

    Moreover, in that condition if i try to restart wmi service it does not restarts as well.

    The behaviour continues till i restart my machine.

    What idea or suggestion how can I avoid this malfunctioning.

    Thanks and Regards,
    Maverick.
Working...