title: run robocopy bat to copy entire drive to another drive
body: <p>I'm trying to run a simple backup (mirror) of one entire drive (d:) to another drive (k:). I've created a .bat file ('backup.bat') defining the source (d:) and destination (k:) and placed this batch file within a folder on the d drive (d:\temp). When I double-click on the batch file it defines the source as d:\temp, instead of what I've defined it as in the batch file; d:. </p>
  
  <p>Here is the text in the .bat file:</p>
  
  <pre><code>@echo off
  echo To begin backing up data:
  pause
  robocopy "D:" "K:" /L /v                 
  echo.
  pause
  exit
  </code></pre>
  
  <p>And this is what shows up when I double-click on the backup.bat</p>
  
  <p><img src="https://i.stack.imgur.com/TAKU3.png" alt="enter image description here"></p>
  
  <p>As you can see, source is defined as d:\temp. This is where the batch file is located, but in the batch file I defined it as D:. For some reason, the destination is defined correctly.</p>
  
  <p>Any ideas? </p>
  
  <p>-al</p>
  
  <p>EDIT: If I add the '/' to the source and destination location, see code below, I see even more odd behavior (see screenshot). The source is now both the defined source and destination combined, w/ no destination. </p>
  
  <pre><code>@echo off
  
  echo To begin backing up data:
  pause
  
  robocopy "D:\" "K:\" /L /v
  
  
  echo.            
  pause
  exit
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/uP25u.png" alt="enter image description here"></p>
  
  <p>And, if I remove the "" from the source and destination....IT WORKs! </p>
  
  <pre><code>@echo off
  
  echo To begin backing up data:
  pause
  
  robocopy D:\ K:\ /L /v
  echo.            
  pause
  exit
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/4snQV.png" alt="enter image description here"></p>