title: How to set an env variable in a batch file from a script command
body: <p>How to set an env variable in a batch file from a script command?</p>
  <pre><code>git log -1 --pretty=%h
  </code></pre>
  <p>I am running many commands in batch file and I want to set the value of this script in an env variable and use this variable. I am using windows OS.</p>
  <p>Hence I require to have something like this:</p>
  <pre><code>SET TAG_NAME=git log -1 --pretty=%h
  </code></pre>