I have to create a batch file that before running a program check that the same is not already running (warning if it is).
Otherwise it can start the program.
The program can be found in: C: \ Program files (x86) \ Artel \ arca.exe
Please you create a batch file for me ?
BATCH file for check and start
Moderator: DosItHelp
Re: BATCH file for check and start
Give that a go:
Steffen
Code: Select all
@echo off &setlocal
tasklist /nh /fo csv /fi "imagename eq arca.exe"|>nul find """arca.exe"""
if errorlevel 1 (
start "" "C:\Program Files (x86)\Artel\arca.exe"
goto :eof
)
echo Program already running.
pause
-
- Posts: 2
- Joined: 24 Jan 2021 07:04
Re: BATCH file for check and start
thanks but the file always opens the program even if it is already running
Re: BATCH file for check and start
Might be that arca.exe is only a launcher which terminates as soon as the actual application is running. Try to figure out which process(es) indicate the running program. You may find them in the details tab of the task manager.
Steffen
Steffen