title: Loop and wait batch file
body: <p>I have made a batch script with a start /wait and a check if it's run again. If not go to shut down script if it runs again wait again but it not work it starts the program over and over.</p>
  
  <p>Can someone tell me what to do?</p>
  
  <pre><code>@ECHO OFF
  :START
  START /WAIT "" "C:\Program Files (x86)\Steam\Steam.exe" -bigpicture
  timeout /t 10 &gt; nul
  tasklist | find /I "Steam"
  if errorlevel 1 (
      START C:\Scripts\shutdown.vbs
  ) else (
      GOTO START
  )
  EXIT
  </code></pre>