I have a Console app on C# that is going to be deployed 4 times, with different configuration files, each instance will be fire off using a Windows Task scheduler, each will be running process and sometimes will be a long running process. Each task is configured to run every hour. How to avoid that scheduler create a new instance of the app that stills running so it wont run again the process that still pending but maybe is being process by the previous instance that is running.
Edit
It is going to be deployed once with 4 different configuration files, that will run independently using different DBs, so it will be some times long process. So I don't know how to identify each instance, so in the case that my instance 1 is running and the task scheduler for that specific configuration don't run again, so it will skip this run
Thanks