1

I want to use a conditional in my batch file, so that it opens a program, but only if that program isn't already running. Very roughly, something like:

@echo off

::(Insert IF conditional here, if program is running, then exit, if not, then continue)

cd "C:\xampp"
start xampp-control.exe

exit

I'd be super appreciative of any idea. Thanks!

  • 1
    I usually use `tasklist | find /i "xampp-control.exe" >NUL && ( echo Program is already running ) || ( start xampp-control.exe )` or similar. – rojo Jul 10 '17 at 16:18
  • See [**How to check if a process is running via a batch script**](https://stackoverflow.com/questions/162291/how-to-check-if-a-process-is-running-via-a-batch-script) – David C. Rankin Jul 10 '17 at 16:18

0 Answers0