title: Calling a Batch file using parameters with spaces in the path in SQL Server Agent job
body: <p>I am running a batch file from the below location in a SQL Server Agent Job step:</p>
  
  <pre><code>"D:\Program Files\Cincom\Control\2212\Prd\Dcls\DEV1-MIKE1_RUN_Batch_JOB"
  </code></pre>
  
  <p>I want to pass a parameter in to run an IF statement.  However, when I do this:</p>
  
  <pre><code>"D:\Program Files\MyProgram\Dcls\DEV1-MIKE1_RUN_Batch_JOB 1"
  </code></pre>
  
  <p>I get the <strong>'is not recognized as an internal or external command, operable program or batch file'</strong> error</p>
  
  <p>Same thing with:</p>
  
  <pre><code>"D:\Program Files\MyProgram\Dcls\DEV1-MIKE1_RUN_Batch_JOB '1'"
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>"D:\Program Files\MyProgram\Dcls\DEV1-MIKE1_RUN_Batch_JOB "1" "
  </code></pre>
  
  <p>I need to pass the parameter and I need to run the batch file from the given location.  Any ideas?</p>