title: Running batch files sequentially in win 7 task scheduler
body: <p>I have 2 batch files as "actions" in a single task.  The first one does a scan for viruses using microsoft security essentials.  The second one puts the computer to sleep.  The problem is that when the task is run, it seems like both batch files run simultaneously, that is, I can see the start of the virus scan, but then the computer goes to sleep almost immediately, so the scan really never has a chance to start.  I understood that batch files would run in sequential order in the task scheduler.  Am I wrong?  How do I make the sleep batch file wait until the scan batch file has completed?  Here are the 2 simple batch files...</p>
  
  <p><strong>Batch file one</strong></p>
  
  <p>"C:\Program Files\Microsoft Security Essentials\MpCmdRun.exe" -scan -scantype 1</p>
  
  <p><strong>Batch file two</strong></p>
  
  <p>powercfg -h off</p>
  
  <p>rundll32.exe powrprof.dll,SetSuspendState 0,1,0</p>
  
  <p>powercfg -h on</p>