title: Batch to run a MSI package multiple times successfully
body: <p>I have written the following code, to run a single.msi package multiple times however it runs only once successfully and gives "Repair" or "Uninstall" option the very next time.
  I need to get this resolved and have it run multiple times. </p>
  
  <p>I have read that I need to author a transform(.mst) for this type of action to be performed successfully but unsure how to do it.</p>
  
  <p>Please note that "OID_VALUE" &amp; "LOGGING_SERVICE_URI_VALUE" are values that I need to pass for the .msi package to run.</p>
  
  <pre><code>@echo OFF
  
  setLocal enableDELAYedexpansion
  
  :MENU
  ECHO.
  ECHO Select the Environment you are running the batch
  ECHO.
  ECHO    1.  UAT
  ECHO    2.  Production
  ECHO    3.  EXIT
  ECHO.
  CHOICE /C 123 /N /M "Select option:"
  if errorlevel 3 EXIT                                                                                
  if errorlevel 2 goto PROD                                      
  if errorlevel 1 goto UAT
  
  :UAT
  set URI=https://log.acdmuat.appleclouds.com/LoggingService/
  GOTO LOGGINGURI
  
  :PROD
  set URI=https://log.acdm.appleclouds.com/LoggingService/
  
  :LOGGINGURI
  for /f "delims=" %%a in (oid.txt) do (
  msiexec /q /l* c:\temp\installer.log /i 
  "C:\AHSInstall\Apple\Apple.msi" OID_VALUE="%%a" LOGGING_SERVICE_URI_VALUE=%URI%
  )
  
  Pause
  </code></pre>