title: File redirection from Program data to AppData\Local\VirtualStore\ProgramData
body: <p>I am using C# with .net 3.5</p>
  
  <p>I am saving my program data in a file under: C:\Program Data\MyProgramName\fileName.xml</p>
  
  <p>After installing and running my application one time I uninstalled it (during uninstallation I'm removing all the files from "program data") 
  and then I reinstall the application, and ran it.</p>
  
  <p>The strange thig is that my application started as if the files in program data existed - means, I had old data in my app even though the data file was deleted.</p>
  
  <p>When running:</p>
  
  <pre><code>File.Exists("C:\Program Data\MyProgramName\fileName.xml")
  </code></pre>
  
  <p>I got "true" even though I knew for sure that the file does not exist.</p>
  
  <p>The thing became stranger when I ran the application  as admin and then the file didn't exist.</p>
  
  <p>After a research, I found out that when running my application with no admin priviliges instead of getting: "C:\Program Data\MyProgramName\fileName.xml" I get "C:\Users\userName\AppData\Local\VirtualStore\ProgramData\MyProgramName\fileName.xml"</p>
  
  <p>and indeed there was a file that existed from the previous installation (that I obviously didn't delete ,because I didn't know it existed).</p>
  
  <p>So apparentlly there is some virtual path to the file under program data.</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>I found out that after deleting the old file in the virtual store, my application is suddenly able to find the correct file. (I didn't make any changes in the file under Program Data.</p>
  
  <p>My question is:</p>
  
  <ol>
  <li>why is it happen.</li>
  <li>How can I prevent it from happening</li>
  </ol>
  
  <p>Thanks in advance</p>