title: Batch File to Check for Running Program and Start if not Running is not working
body: <p>I have been trying to get this batch file to work but keep running into issues. I think I am close but need help getting this working. When the script runs I get Find: Parameter format not correct. </p>
  
  <p>I am running this on a Windows Server 2008 R2 Standard.      </p>
  
  <pre><code>@echo off 
  
  
  tasklist /FI "IMAGENAME eq program.exe" | find /i “program.exe" 
  
  
  IF ERRORLEVEL 2 GOTO NEXTPROGRAM
  
  IF ERRORLEVEL 1 GOTO LAUNCHPROGRAM
  
  
  :NEXTPROGRAM
  
  goto SMADMIN
  
  
  
  :LAUNCHPROGRAM
  
  start "" "C:\path\to\program.exe"
  
  goto SMADMIN
  
  
  :SMADMIN
  
  tasklist /FI "IMAGENAME eq program1.exe" | find /i “program1.exe" 
  
  
  IF ERRORLEVEL 2 GOTO NEXTPROGRAM2
  
  IF ERRORLEVEL 1 GOTO LAUNCHPROGRAM2
  
  
  :NEXTPROGRAM2
  
  goto COMPLETE
  
  
  
  :LAUNCHPROGRAM2
  
  start "" "C:\path\to\program1.exe"
  
  goto COMPLETE
  </code></pre>