title: How can I avoid error MSB3073 with code -1 from Exec with visual studio while still using sysnative virtual folder
body: <p>This is a followup of a <a href="https://stackoverflow.com/questions/55285981/why-is-oscdimg-exe-under-visual-studio-not-recognized-as-an-internal-or-extern/55290123#55290123">question</a> I asked before. In a nutshell I run a 64 bit version of cmd from visual studio (which is 32 bit application). I do this because I need to run a command oscdimg.exe which is only accessible from 64 bit version of cmd.</p>
  
  <pre><code>  &lt;Target Name="AfterBuild"&gt;  
      &lt;Exec Command="%windir%\sysnative\cmd.exe /c &amp;quot;$(ProjectDir)test.bat UPLOAD&amp;quot;" WorkingDirectory="$(ProjectDir)" /&gt;
    &lt;/Target&gt;
  </code></pre>
  
  <p>Now while this works fine, I receive following error.</p>
  
  <p>error MSB3073: The command "%windir%\sysnative\cmd.exe /c "C:\XXXX\XXX\XXX\test.bat UPLOAD"" exited with code -1.</p>
  
  <p>While this error is not disrupting my work, meaning the batch performs its tasks successfully, it still is nice to fix this error message, as others in my team questions this error message.</p>
  
  <p>I am making an assumption that this error is triggered because although the visual studio is 32 bit application, the build or exec calls for windows operating system application which may be 64 bit application. And 64 bit application cannot see the <a href="https://www.samlogic.net/articles/sysnative-folder-64-bit-windows.htm" rel="nofollow noreferrer">sysnative virtual folder.</a></p>
  
  <p>Is there any way to resolve this error? </p>
  
  <p>EDIT: Added argument to the command to simulate the real use and to show the reason I add <code>&amp;quot;</code>.</p>