title: Simple bat file log to text but error
body: <p>I created 2 simple bat files, and I keep on getting the same error on both. I wanted to log what is on the bat file into a text document. The error is : <code>The process cannot access the file because it is being used by another process.</code>  Is it because I am Called the bat file within itself?</p>
  
  <p><strong>Code 1</strong></p>
  
  <pre><code>@echo off
  
  :BEGIN
  net stop redmineMongrel1
  TIMEOUT /T 15
  net start redmineMongrel1
  goto SUCCESS
  
  :SUCCESS
  "C:\Documents and Settings\Administrator\My Documents\MongrelRestartScript.bat" &gt; "C:\Documents and Settings\Administrator\My Documents\MongrelRestart.log"
  ECHO Mongrel Restart Successful  %DATE%&gt;&gt; "C:\Documents and Settings\Administrator\My Documents\MongrelRestart.log"
  goto END
  
  :FAIL
  ECHO.&gt;"C:\Documents and Settings\Administrator\My Documents\MongrelRestart.log"
  ECHO Mongrel Restart FAILED %DATE%&gt;&gt; "C:\Documents and Settings\Administrator\My Documents\MongrelRestart.log"
  
  :END
  echo END OF BAT FILE
  </code></pre>
  
  <p><strong>Code 2</strong></p>
  
  <pre><code>@echo off
  
  
  :BEGIN
  DEL "D:\BACKUPS\RedmineFolder" /s /q 
  RD "D:\BACKUPS\RedmineFolder" /s /q
  
  
  xcopy C:\BitNami\apps\redmine "D:\BACKUPS\RedmineFolder" /e /h /r /y /I
  goto SUCCESS
  
  :SUCCESS
  ECHO.&gt;"C:\Documents and Settings\Administrator\My Documents\RedmineBackupLog.log"
  ECHO Redmine Backup Successful  %DATE%&gt;&gt; "C:\Documents and Settings\Administrator\My Documents\RedmineBackupLog.log"
  "C:\Documents and Settings\Administrator\My Documents\RedmineBackUpScript.bat" &gt;&gt; "C:\Documents and Settings\Administrator\My Documents\RedmineBackupLog.log"
  goto END
  
  :FAIL
  ECHO.&gt;"C:\Documents and Settings\Administrator\My Documents\RedmineBackupLog.log"
  ECHO Redmine Backup  FAILED %DATE%&gt;&gt; "C:\Documents and Settings\Administrator\My Documents\RedmineBackupLog.log"
  
  :END
  echo END OF BAT FILE
  </code></pre>