title: How to write to the common Application Data folder?
body: <p>I have a Visual Basic 6.0 application that I want to install for <em>All Users</em>, for example, the setting are held in a single spot regardless who logs into the computer. I have the following code to locate the common location:</p>
  
  <pre><code>Const ssfCOMMONAPPDATA = &amp;H23
  Dim strAllUsersPath As String
  
  strAllUsersPath = CreateObject("Shell.Application").NameSpace(ssfCOMMONAPPDATA).Self.Path
  </code></pre>
  
  <p>On Windows XP, this path points to <code>C:\Documents and Settings\All Users\Application Data\</code> folder. The setup copies the settings file there and everything is great. The Visual Basic 6.0 app can change it at any time.</p>
  
  <p>On Windows 7, this path points to <code>c:\ProgramData</code> folder. The setup, which requires administrator privileges, copies the file there.  However, when my Visual Basic 6.0 application starts and accesses the file, Windows 7 copies the settings file to a C:\Users{USER LOGIN}\AppData\Local\VirtualStore\ and performs all the operations on it there. As a result, because for each user, Windows 7 copies the settings file to a separate user directory, the users end up having a different settings file.</p>
  
  <p>Am I storing the file in the wrong location? Am I doing it in the incorrect manner?</p>