title: WIX invoking Batch file in InstallExecution Sequence
body: <p>I am new to WIX and I am trying to invoke a batch file from my WIX installer.
  MyBatch.bat contains a simple Copy of a Text file from c:\ to D:\</p>
  
  <p>I am unable to invoke the batch file. Below is my code.</p>
  
  <p>Please help me out.</p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt;
    &lt;?define ProductName='Test Product' ?&gt;
    &lt;?define ProductVersion='1.0.0.0' ?&gt;
    &lt;?define ProductCode='b7bc7c6f-9a4e-4973-be84-eca8e3427c97'?&gt;
    &lt;?define UpgradeCode='06a81104-1e30-463d-87e1-e8a79b4c682a'?&gt;
    &lt;?define Manufacturer='Respond'?&gt;
    &lt;Product Id="$(var.ProductCode)" Language="1033" Version='$(var.ProductVersion)' Name='Respond'
    Manufacturer='$(var.Manufacturer)' UpgradeCode='$(var.UpgradeCode)'&gt;
      &lt;Package InstallerVersion='200' Compressed='yes' /&gt;
      &lt;Media Cabinet='media1.cab' EmbedCab='yes' Id ='1' /&gt;
      &lt;Directory Id="TARGETDIR" Name="SourceDir"&gt;
        &lt;Directory Id='ProgramFilesFolder'&gt;
          &lt;Directory Id='INSTALLDIR' Name='$(var.ProductName)'&gt;
            &lt;Component Id='ProductComponent' Guid='b11556a2-e066-4393-af5c-9c9210187eb2'&gt;
              &lt;File Id='Calc' DiskId='1' Source='C:\WINDOWS\system32\calc.exe'/&gt;
              &lt;File Id='my_batch_script' Name='MyBatch.bat' DiskId='1' Source='MyBatch.bat'   /&gt;
            &lt;/Component&gt;
          &lt;/Directory&gt;
        &lt;/Directory&gt;
        &lt;Directory Id='ProgramMenuFolder'&gt;
          &lt;Directory Id='ApplicationProgramsFolder' Name='$(var.ProductName)'&gt;
            &lt;Component Id='MainExecutable' Guid='EDED00D8-2465-46CA-86D6-B20DE921EFA6'&gt;
              &lt;Shortcut Id='ShortcutCalc' Description='$(var.ProductName)' Name ='Calculator of Windows'
              Target='[INSTALLLOCATION]Calc.exe' WorkingDirectory='INSTALLLOCATION'/&gt;
              &lt;RemoveFolder Id='ApplicationProgramsFolder' On='uninstall'/&gt;
              &lt;RegistryValue Root='HKCU' Key='Software\$(var.Manufacturer)\$(var.ProductName)' Type ='multiString'
              Name='installed' Value='1' KeyPath='yes'/&gt;
            &lt;/Component&gt;
          &lt;/Directory&gt;
        &lt;/Directory&gt;
      &lt;/Directory&gt;
  
      &lt;Feature Title='SetupProject1' Level='1' Id ='AppFeature'&gt;
        &lt;ComponentRef Id='ProductComponent' Primary='yes'/&gt;
        &lt;ComponentRef Id='MainExecutable'/&gt;
      &lt;/Feature&gt;
  
      &lt;Property Id='WIXUI_INSTALLDIR' Value='INSTALLDIR' &gt;&lt;/Property&gt;
      &lt;WixVariable Id='WixUILicenseRtf' Overridable='yes' Value='License.rtf'/&gt;
      &lt;?include CustomActions.wxi?&gt;
      &lt;UI&gt;
        &lt;?include UISequence.wxi?&gt;
        &lt;?include Dialogs.wxi?&gt;
      &lt;/UI&gt;
  
      &lt;CustomAction Id="BatchCmd" Property="ThePath" Value="[INSTALLDIR]MyBatch.bat" /&gt;
      &lt;CustomAction Id="BatchRun" Property="ThePath" ExeCommand='"[INSTALLDIR]MyBatch.bat"' Return='asyncWait' Impersonate="yes"/&gt;
  
      &lt;InstallExecuteSequence&gt;
        &lt;Custom Action="BatchCmd" After="InstallFiles" &gt;Not Installed &lt;/Custom&gt;
        &lt;Custom Action="BatchRun" After="BatchCmd"&gt;Not Installed &lt;/Custom&gt;
      &lt;/InstallExecuteSequence&gt;
    &lt;/Product&gt;
  
  &lt;/Wix&gt;
  </code></pre>