Answer the question
In order to leave comments, you need to log in
Why does a bat file of 2 lines take a long time to execute?
The task is to prohibit opening a second copy of the program for the user (in the example admin). But the process search takes a long time due to the use of filters. How to speed up the work of bat'nik?
tasklist /fi "USERNAME eq admin" | find /i "EasyCeiling.exe"
if %errorlevel%==1 (goto :Run0) else (goto :Run1)
Answer the question
In order to leave comments, you need to log in
tasklist generally works long enough.
Add filtering by EasyCeiling.exe to the filter, so that the tasklist gives out only the necessary processes, perhaps the speed will increase.
You can try other tools to get a list of processes, such as wmic. But I doubt that something else will be much faster.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question