title: pass value from vbscript to batch
body: <p>I have two files: batch.bat and vbscript.vbs. The .bat file contains a loop where I need to call the .vbs, passing to it 2 arguments. The .vbs file contains a function with 2 arguments( the arguments I am passing to the .vbs file). I need to have access in the .bat file to the value my function in .vbs returns.<br>
  Could someone help me, please?</p>
  
  <p>I am not an expert so please excuse my poor syntax. I am calling the .bat file. The files should look something like this</p>
  
  <p>batch.bat :</p>
  
  <pre><code>loop start
  
  ' calling the vbs file
  
  cscript vbscript.vbs arg1 arg2 ( here I suppose something has to be add to get val from vbs)
  
  ' using value returned by .vbs function
  
  loop end 
  </code></pre>
  
  <p>vbscript.vbs :</p>
  
  <pre><code>function myfunction(arg1,arg2)
  dim value
  
  ' do some calculation
  
  myfunction= value
  end function
  
  dim value_to_return_to_batch
  ' now calling the function
  value_to_return_to_batch=myfunction(arg1,arg2)
  '
  ' here something has to be add to send value_to_return_to_batch  to batch
  '
  </code></pre>