title: Batch script to install MSI
body: <p>I am trying to write a <strong>.bat</strong> for the first time.</p>
  
  <p>I am trying to install .msi using script, currently we are installing manually by double clicking on it.</p>
  
  <p><em>Path from</em>: <code>d:/installed sw/$folder/.msi</code></p>
  
  <p><em>Path to</em>: <code>D:/program files/app/</code></p>
  
  <p><code>$folder</code> means, it is different every time, as we are getting new msi to install which are provided in folder created by current date.</p>
  
  <p>Here is the script I am trying:</p>
  
  <pre class="lang-dos prettyprint-override"><code>@echo off
  Title HOST: Installing Updates on %computername%
  echo %computername%
  set server=\\SERVERNAME or PATH\msifolder
  :select
  cls
  echo Select one of the Following MSI Install Folders for installation task.
  echo.
  dir %server% /A:D /B
  SET /P MSI=Please enter the MSI Folder to install: 
  SET source=%server%\%MSI%
  echo Selected Installation %MSI%
  echo.
  echo.
  
  :verify
  ECHO Is This Correct?
  echo.
  echo.
  ECHO 0: ABORT INSTALL
  ECHO 1: YES
  ECHO 2: NO,RE-SELECT
  SET /p choice=Select YES, NO or ABORT? [0,1,2]:
       if /i [%choice%]==[0] endlocal&amp;goto end
       if [%choice%]==[] goto BCurrentlocal
       if [%choice%]==[1] goto yes
   if [%choice%]==[2] goto no
   endlocal
  
  :no
  goto select
  :yes
  set FILENAME=%MSI%
  call %source%\%FILENAME%.msi
  echo beginning %MSI% installation
  pause
  echo Exiting Install Script....
  PING -n 4 127.0.0.1 &gt;nul
  exit
  </code></pre>
  
  <p>In line with <code>set server</code> I am adding the <em>path to</em>.</p>
  
  <p><code>SET /P MSI</code> is for <em>path from</em>.</p>
  
  <p>However, it is not working.</p>
  
  <p>Can anyone guide me what mistake I am doing?</p>