title: windows batch file not exiting
body: <p>I am not good at windows scripting. (I am linux guy)
  I have to delete files which they are older than n days in two directories. 
  I am using 2 forfiles command in script. When I run the script manually there is no problem so it's running and finishing its job properly and it takes about 30 seconds to finish</p>
  
  <p>So I created a task to run this batch file everyday in task scheduler
  When Task Scheduler executes the script, the script could not end and I could see a running forfiles command in task manager and following day task manager creates a log the script/command is already running. So I am terminating script and run <strong>"manually"</strong> again, it successfully run and finishes its job in 30-35 seconds again</p>
  
  <p>My script is like that</p>
  
  <pre><code>y:
  cd \&lt;path1&gt;
  forfiles /s /d -120 /m *.* /c "cmd /c del @path"
  cd \&lt;path2&gt;
  forfiles /s /d -120 /m *.* /c "cmd /c del @path"
  EXIT
  </code></pre>
  
  <p>How can I run this batch file from task manager properly ?</p>
  
  <p>Thanks</p>