Important: Please read the Qt Code of Conduct -

Can't find ProgramData folder for windows.

  • Greetings,

    I want to locate a ProgramData (or C:\Documents and Settings\All Users\Application Data). I'm using QStandardPaths class. I tried a bunch of different StandardLocations. But I always have C:/Users/myuser/... folder, i.e. not public folder. Currently I'm using windows API for that, but maybe I'm just doing something wrong.

    Qt 5.4.0, Win7.

  • Some of these functions should return more than one item. Does none of them contain the path you need?

  • That's right, no one.

  • Hi, I also tried Qt for that directory, but alas, you have to venture into the bowels of Windows:
    #include "shlobj.h"

    TCHAR szPath[MAX_PATH];
    QString sCommonAppData = QString::fromWCharArray(szPath);

Log in to reply