Link to home
Create AccountLog in
Avatar of markdolar
markdolarFlag for United States of America

asked on

Preventing two executables from running at the same time on Windows

Hello Experts;

I have two programs, including source code:

a.exe
b.exe

I would like it so the user cannot run b.exe when a.exe is running, and vice/versa.

What is the best way to accomplish this, considering that if the running program fails for some reason, then it may not exit gracefully and I won't be able to undo a lock mechanism added to the source code?
ASKER CERTIFIED SOLUTION
Avatar of becraig
becraig
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account