none
how to Automatically Detect successful start up of a service and automatically launch another EXE RRS feed

  • Question

  • Hi,

    I want to automatically start an executable, once a specific windows service xyz starts running. The service in question, can start running, for example, on system restart/reboot. Is there is something in Windows, which can help me detect this dependent xyz service startup, and then launch the EXE? Also, once my EXE starts running I want to launch yet another, second EXE. Is there way to detect the first EXEs startup and thus launch the 2nd EXE?

    My applications is written in C Sharp

    Help appreciated. Thanks

     


    diana4
    Monday, June 20, 2011 2:19 AM

Answers

All replies

  • I would suggest writing a Windows Service that is dependant on the other windows service (this is just a configuration)

    On launching, it would execute your first EXE and then the second.If there is a chance that the first EXE may start and terminate due to some conditions, you can make your windows service wait for some time before chacking the state of the first EXE and then launch the second EXE


    Please mark this as answer or vote as helpful if it solved your problem
    Monday, June 20, 2011 8:04 AM
  • Thank you. Any pointers to How write such a simple service and how to make it dependant on other windows service?

     


    diana4
    Monday, June 20, 2011 8:54 AM
  • Check out this link for a guide to a simple windows service :

    http://blogs.msdn.com/b/bclteam/archive/2005/03/15/396428.aspx

    For a dependancy, add this line in the installer

    serviceInstaller.ServicesDependedOn = new[] { "<processname>" }; 
    


     


    Please mark this as answer or vote as helpful if it solved your problem
    • Marked as answer by Diana4 Monday, June 20, 2011 2:44 PM
    Monday, June 20, 2011 9:07 AM
  • Another walkthrough is available here:
    http://msdn.microsoft.com/en-us/library/zt39148a.aspx

     

    • Marked as answer by Diana4 Monday, June 20, 2011 2:44 PM
    Monday, June 20, 2011 9:21 AM