title: batch script ended halfway
body: <p>I am on Windows 7 Professional. I have the following files in C:\script. </p>
  
  <pre><code>clamav_daily_scan.bat
  log_email_clamav_daily_scan.bat
  email.vbs
  log.txt
  </code></pre>
  
  <p><strong>log_email_clamav_daily_scan.bat</strong></p>
  
  <pre><code>@echo off
  @echo set variables
  SET DATETIME=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%%TIME:~9,2%
  SET LOG_DIR="%PROGRAMFILES(X86)%"\ClamWin\bin\daily_scan\log
  SET LOG_FILENAME=clamscanlog_%DATETIME%.txt
  
  @echo start daily scan
  C:\script\clamav_daily_scan.bat &gt; %LOG_DIR%\%LOG_FILENAME%
  
  @echo send result
  C:\Windows\SysWOW64\cscript.exe C:\script\email.vbs %LOG_DIR%\%LOG_FILENAME%
  </code></pre>
  
  <p>When I execute log_email_clamav_daily_scan.bat on cmd, it only stop until start daily scan.</p>
  
  <pre><code>C:\script\log_email_clamav_daily_scan.bat
  set variables
  start daily scan
  </code></pre>