CommonAppData in vb6

shell, special-folders, vb6, windows

Solution

Use late binding:

Const ssfCOMMONAPPDATA = &H23
Dim strCommonAppData As String

strCommonAppData = _
    CreateObject("Shell.Application").NameSpace(ssfCOMMONAPPDATA).Self.Path

Problem

Basically the same as this question, but for VB6. A customer's application "AppName" has its configuration files stored in CommonAppData. - Under Windows XP that is C:\Documents and Settings\All Users\Application Data\AppName - Under Windows Vista that is C:\ProgramData\AppName How do I get the correct foldername with VB6?? Additional notes, I prefer to use a API Call instead of adding a reference to the shell32.dll

Original source

Related problems