So I want to use a batch file to open another file, but I don’t want it to open if it is already open twice (if the file is already open on the user’s desktop twice). Is it possible to do that in a batch file? Like, if I were to open notepad, if notepad was already open twice, then it wouldn’t open notepad, but if notepad wasn’t open at all, then it would open notepad twice.
Is that possible?
Also is it possible to disable the close (X) button on a batch file?
To check if an executable is already running, try this
Additionally, you get in %%B the PID of the already running executable if you want to do something with it.