Search code examples
c++winapivisual-c++win32-process

Developing an application to restart another application


I need to write an application which will be installed inside a windows7 embedded enterprise O/S. This applications job is to restart another application at a pre-configured time each day. Can you please tell me which API's do i need to refer for this purpose? Do i need to depend on the windows scheduler for this task? Is it possible to configure the scheduler from win32 code?

Is there any application which does this job already exist in the market?

Thanks, John.


Solution

  • You can do this from a batch file.

    First, prepare a script, e.g. "restart.bat" to kill the process and restart it, killing can be done by taskkill, restarting should be done by start to not block current script.

    Then create setup batch file to add "restart.bat" to task scheduler