Skip to main content
How many times a program can be executed. Hi, I need your help to know if there is an option to control the number of times you can run a cobol program in windowsm 10. For example, I have an icon to run box01, such as controlling that on the same PC you can only run just one time.
How many times a program can be executed. Hi, I need your help to know if there is an option to control the number of times you can run a cobol program in windowsm 10. For example, I have an icon to run box01, such as controlling that on the same PC you can only run just one time.

the way I do it is open a text file with exclusive lock but before doing that, try to delete the file and then if it doesn't delete, you know the process is running already and you can exit.

The only times I've see that fail is when the program crashes and the OS still has the file open and you have to force close the file. Either that or the rmcobol process is still in the memory and you have to kill the running task. That hasn't happened in many years though.