title: C# Windows Service Access denied when trying to write in a folder
body: <p>I have deployed successfully a C# windows service on a windows 7 machine.</p>
  
  <p>Now, when I try to create a file using this code :</p>
  
  <pre><code>  FileStream os = new FileStream(String.Format(folderName, fileName), FileMode.Create);
  </code></pre>
  
  <p>I get Access to filepath is denied.</p>
  
  <p>In the service Installer I set the following parameters to :</p>
  
  <pre><code>   this.serviceProcessInstaller1.Account = 
         System.ServiceProcess.ServiceAccount.LocalSystem;
     this.serviceProcessInstaller1.Password = "Pass";
     this.serviceProcessInstaller1.Username = "Administrator"
  </code></pre>
  
  <p>I added all the possible accounts with Full permissions to the folder where I want to create the file but nothing helped.</p>
  
  <p>Any suggestions would be highly appreciated</p>