title: GUI for running batch files
body: <p>I have 3 batch files. One of them requires input from the user. I wonder how I can have a GUI with 3 buttons (1 for each batch file) and a textbox for user entry which will be used by one of the batch files?</p>
  
  <p>I'm trying to use <a href="https://stackoverflow.com/a/34870295/1460166">this answer</a> to make it as shown below:</p>
  
  <pre><code>&lt;!-- :: Batch section
  @echo off
  setlocal
  
  echo Select an option:
  for /F "delims=" %%a in ('mshta.exe "%~F0"') do set "HTAreply=%%a"
  echo End of HTA window, reply: "%HTAreply%"
  goto :EOF
  --&gt;
  
  
  &lt;HTML&gt;
  &lt;HEAD&gt;
  &lt;HTA:APPLICATION SCROLL="no" SYSMENU="no" &gt;
  &lt;body bgcolor="cyan"&gt;
  &lt;TITLE&gt;HTA Buttons&lt;/TITLE&gt;
  &lt;SCRIPT language="JavaScript"&gt;
  window.resizeTo(374,100);
  
  function closeHTA(reply){
     var fso = new ActiveXObject("Scripting.FileSystemObject");
     fso.GetStandardStream(1).WriteLine(reply);
     window.close();
  }
  
  &lt;/SCRIPT&gt;
  &lt;/HEAD&gt;
  &lt;BODY&gt;
     &lt;button onclick="call C:\Users\user1\Documents\bat1.bat";closeHTA(1);&gt;Bat1&lt;/button&gt;
     &lt;button onclick="call C:\Users\user1\Documents\bat2.bat;closeHTA(2);"&gt;Bat2&lt;/button&gt;
     &lt;button onclick="call C:\Users\user1\Documents\bat3.bat;closeHTA(3);"&gt;Bat3&lt;/button&gt;
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>by I'm facing couple of problems:</p>
  
  <ol>
  <li>I get an error in line <code>&lt;button onclick="call C:\Users\user1\Documents\bat1.bat";closeHTA(1);&gt;Bat1&lt;/button&gt;</code> saying a semicolon is expected as shown below, I'm not sure if this is the correct way to call a batchfile in this part?
  <a href="https://i.stack.imgur.com/8pUAI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8pUAI.png" alt="enter image description here"></a></li>
  <li>How I can have a textbox so I can enter a parameter and pass it to one of the batch files?</li>
  <li>The GUI and cmd are not anchored so if I closed the cmd the GUI of the buttons still exists and doesn't close as shown below:
  <a href="https://i.stack.imgur.com/7aVKn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7aVKn.png" alt="enter image description here"></a></li>
  </ol>