title: Batch File - If File Drive Letter Equals W then
body: <p>I have what I believe should be an easy answer to a question but I am having a difficult time figuring out the coding for it.</p>
  
  <p>I have a batch file that runs when single or multiple files are sent through the SEND TO command when right clicking.</p>
  
  <p>What I would like is if the file(s) are coming or located on a specific drive letter then it will go to a dialog and end.</p>
  
  <p>I just need help figuring out the drive letter part...</p>
  
  <p>if "file directory letter" = W: goto :errordialog</p>
  
  <p>I have tried:</p>
  
  <pre><code>if %cd%=="W:\" goto :errordialog
  if %~d1=="W:\" goto :errordialog
  </code></pre>
  
  <p>I have tried other codes but I think I have to do it another way?</p>
  
  <p>I know I have to be making this too hard right?</p>