title: How to execute a program in set variable?
body: <p>I'm writing the universal batch script for a Git upload.</p>
  <p>I want to specify the location of the <code>Git</code> executable, if user doesn't provide one/is not located by <code>where</code> command.</p>
  <pre><code>C:\&gt;@echo off
  
  set Windows=C:\Windows\System32
  set where=%Windows%\where.exe
  
  : --- Git location ---
  set &quot;Git=...&quot;    Executable
  
  if %Git%==... (
      set &quot;Git=%where% git.exe&quot;    : &lt;---
  )
  
  echo %Git%
  where git.exe
  
  %Git%
  C:\Program Files (x86)\Git\cmd\git.exe
  </code></pre>
  <p>The problem is, that executing a variable is different than <code>echo</code>ing it.</p>
  <p><strong>How can I make <code>echo %Git%</code> output <code>C:\Program Files (x86)\Git\cmd\git.exe</code>?</strong></p>