Answer the question
In order to leave comments, you need to log in
How to exclude the possibility of running the same bat file?
Good day.
I have run.bat
With this content
start /d "C:\Users\valinor\Desktop\site\dist" main.exe --dir='D:\ttt'
# папка1 по пути скажем C:\\data
start /d "C:\Users\valinor\Desktop\site\dist" main.exe --dir='D:\path1'
# папка2 по пути скажем C:\\data2
start /d "C:\Users\valinor\Desktop\site\dist" main.exe --dir='D:\path2'
Answer the question
In order to leave comments, you need to log in
Do not make the restart control a batch file, it will be inconvenient, there is a topic where this was discussed there are examples
Better let the application itself do this, create a lock file (let the file name be in the parameters) with the pid of the process, when starting the application, it must check if the process exists with such pid as it is written in the file (if it exists), if there is - exit, if not - overwrite the file with your pid and continue working.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question