title: Shutdown in BAT - Windows 7
body: <p>I have this .bat file here which kills everything and then shutdown the computer. The problem is that this shutdown command is not working ... amd I doing something wrong? I'm killing everything before shutting down because this way the shutdown is faster, thanks!</p>
  
  <pre><code>@echo off
  for /f "skip=3 tokens=1" %%i in ('TASKLIST /FI "USERNAME eq %userdomain%\%username%" /FI "STATUS eq running"') do (
      if not "%%i"=="svchost.exe" (
          if not "%%i"=="explorer.exe" (
              if not "%%i"=="cmd.exe" (
                  if not "%%i"=="tasklist.exe" (
                      echo.
                      Taskkill /f /im "%%i" 
                      echo.
                  )
              )
          )
      )
  )
  
  shutdown /s /f /t 00
  </code></pre>