I have a Visual Basic 6.0 application that I want to install for all users, for example, the settings are stored in one place regardless of who logs on to the computer. I have the following code to find a general location:
Const ssfCOMMONAPPDATA = &H23 Dim strAllUsersPath As String strAllUsersPath = CreateObject("Shell.Application").NameSpace(ssfCOMMONAPPDATA).Self.Path
In Windows XP, this path points to the folder C:\Documents and Settings\All Users\Application Data\
. Setup copies the settings file there, and everything is fine. Visual Basic 6.0 can change it at any time.
On Windows 7, this path points to the c:\ProgramData
. A setting that requires administrator rights copies the file there. However, when the Visual Basic 6.0 application starts and accesses the file, Windows 7 copies the settings file to C: \ Users {USER LOGIN} \ AppData \ Local \ VirtualStore \ and performs all operations on it. As a result, since for each user Windows 7 copies the settings file to a separate user directory, users have a different settings file.
Am I storing the file in the wrong place? Am I doing it wrong?
source share