title: How to redirect output of a batch file to another batch file?
body: <p>I want to create a utility batch file which will be consumed by client batch file.
  The Utility batch file will create the result &amp; will redirect as output.
  The client batch file will call utility.bat &amp; will get the result in a variable.</p>
  
  <p>The code of Utility.bat I have written is as below</p>
  
  <pre><code>echo off
  set result="some info"
  echo %result%
  rem output
  </code></pre>
  
  <p>I am not sure about the syntax of how to pass the result as output </p>
  
  <p>The code of client.batch is as below</p>
  
  <pre><code>@echo off 
  set var1=%Utility.bat%
  echo "%var1%"
  </code></pre>
  
  <p>Need help in syntax to pass result as output.</p>
  
  <p>I found many answers on web for passing result to text file (logging) but that was not my requirement.</p>