title: Need to execute *.exe in server from ASP.net
body: <p>My current situation is that I need to execute an exe(which creates a local .txt file) in remote server with IIS hosting an ASP.net/C# API. I created a local user(say userA) as admin to run the web service in the remote server but the .txt file was not created. I already checked and granted necessary folder permissions to userA and added the user in various groups. The funny thing is that if i am logged in as userA in the remote system, the exe gets executed as expected. If i log out then it fails. Server is Win server 2008 with IIS 7. Any help would be appreciated thanks.</p>
  <p>UPDATE: I've solved the issue and posted the answer and a few links to related issues here on SO. In short, I needed to set 'load user profile' true in IIS app pool.</p>
  <p>Thanks everyone for their contribution</p>
  <p>EDIT: Code extracted from comments</p>
  <pre><code>Process proc = new Process(); 
  proc.StartInfo.FileName = path; 
  proc.StartInfo.Arguments = exeparams; 
  proc.Start(); 
  proc.WaitForExit(); 
  stat = proc.ExitCode; 
  if (stat != 0) 
  { 
      throw new Functions.log(&quot;Error&quot;); 
  } 
  </code></pre>