title: WIX won't execute command
body: <p>I have a WIX installer and I need to run two commands:</p>
  
  <pre><code>net localgroup administrators reviewer /add
  </code></pre>
  
  <p>and</p>
  
  <pre><code>appcmd.exe set config /section:applicationPools /[name='Reviewer'].processModel.identityType:SpecificUser /[name='Reviewer'].processModel.userName:reviewer /[name='Reviewer'].processModel.password:reviewer
  </code></pre>
  
  <p>the second command is quite complex and involved square brackets and single quotes</p>
  
  <p>First command must run from <code>C:\Program files\mycompany\myfolder</code>, the second one from <code>C:\windows\system32\inetsrv</code></p>
  
  <p>Here my two WIX custom actions:</p>
  
  <pre><code>    &lt;CustomAction Id="AssignUserToAdminGroup" Directory="INSTALLFOLDER" Execute="deferred" Impersonate="no"
        ExeCommand="net localgroup administrators reviewer /add" 
        Return="check"/&gt;
  
      &lt;CustomAction Id="AssignUserToIISapp" Directory="IISFOLDER" Execute="deferred" Impersonate="no"
        ExeCommand="appcmd.exe" 
        Return="check"/&gt;  
  </code></pre>
  
  <p>As you may have noticed I removed a lot from the second command just to make sure I don't have to deal with square brackets and single quotes (it's just a test)</p>
  
  <p>Here the fragment which specifies the directories where such commands should be launched from (<code>INSTALLFOLDER</code> and <code>IISFOLDER</code>)  </p>
  
  <pre><code>  &lt;Fragment&gt;
      &lt;Directory Id="TARGETDIR" Name="SourceDir"&gt;
        &lt;Directory Id="CommonAppDataFolder"&gt;
          &lt;Directory Id="Company" Name="mycompany"&gt;
            &lt;Directory Id="INSTALLFOLDER" Name="myfolder" /&gt;
          &lt;/Directory&gt;
        &lt;/Directory&gt;
           &lt;Directory Id="System64Folder" &gt;
          &lt;Directory Id="IISFOLDER" Name="inetsrv"  /&gt;
        &lt;/Directory&gt;
      &lt;/Directory&gt;
    &lt;/Fragment&gt;
  </code></pre>
  
  <p>This code compiles fine but I get an error while installing, the appcmd.exe could not be executed. What's causing the problem? </p>