Introduction
There is some application that we want that only a single instance of application works at a time. So here is the logic for doing that.
Here, I am getting a process list, and I check whether there is a process with the same name as the current process. If yes, then processes. length will be greater than one; then, we exit from the new instance.
Example