title: Msbuild works via VS and command-line, but fails via Jenkins
body: <p>I am trying to build a VS .sln that has multiple C++ .vcproj's in it. The solution file is generated using CMake and I've got this part working in Jenkins (with the CMake builder plugin). To build the solution file, I am using msbuild. I am able to build the solution using both Visual Studio and from the command line with the following command:</p>
  
  <pre><code>C:\Jenkins\workspace\SonioTest&gt;"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" /t:Rebuild bin/SonIO.sln
  </code></pre>
  
  <p>This builds successfully (on the same machine that Jenkins resides).</p>
  
  <p>However, I am trying to automate this portion of the build in Jenkins and the build ends up failing with a couple of <code>C1083</code> errors (<code>"Cannot open source file: '..\path\to\file.ext': No such file or directory</code>). I have tried using both the Jenkins msbuild plugin and using the exact same command that works in the terminal as a "Execute Windows batch command" build step, with the same result.</p>
  
  <p>When using the Windows batch command build step, I can see in the log that the command being executed:</p>
  
  <pre><code>C:\Jenkins\workspace\SonioTest&gt;"C:\Windows\Microsoft.NET\Framework\v4.0.30319 msbuild.exe" /t:Rebuild bin/SonIO.sln
  </code></pre>
  
  <p>... is exactly the same as the one that works from the command line, <em>including</em> the working directory.</p>
  
  <p>I am running Jenkins as a service and I have the service logon as my account (with administrator privileges). Anyone know what directory Jenkins will execute batch commands out of?</p>
  
  <p>Any ideas why I'm seeing this difference of behavior between Jenkins and the command line? </p>