title: checking input command in dos batch file?
body: <p>I am running input arguments as a command in my dos batch file as I asked in:
  <a href="https://stackoverflow.com/questions/9396311/run-a-input-parameter-as-command-in-dos-batch-script">Run an input parameter as command in dos batch script</a>.
  That works, however the problem I am having: checking if the input command if it's empty.
  What I do:</p>
  
  <pre><code>SETLOCAL
  set CMD=%*
  echo Running command [%CMD%]
  IF "%CMD%"=="" (
   echo "Input argument missing: command"
   GOTO :end
  )
  echo "XXX %CMD%"
  </code></pre>
  
  <p>And running: </p>
  
  <pre><code>script.bat echo "a b c"
  </code></pre>
  
  <p>Will output:</p>
  
  <pre><code>Running command [echo "a b c"]
  b was unexpected at this time.
  </code></pre>
  
  <p>This occurs in the IF condition, but why?</p>
  
  <p>How can I check if my input is empty. I know how to check if a string is empty in dos, but for some reason it doesn't work in this combination :(<br>
  BTW: If I remove the IF condition it works well, that is: the command is executed correctly.</p>
  
  <ul>
  <li>Ed</li>
  </ul>