Can't find ProgramData folder for windows.
-
wrote on 30 Jan 2015, 15:14 last edited by
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.
-
wrote on 30 Jan 2015, 15:37 last edited by
Some of these functions should return more than one item. Does none of them contain the path you need?
-
wrote on 30 Jan 2015, 16:09 last edited by
That's right, no one.
-
wrote on 30 Jan 2015, 22:45 last edited by
Hi, I also tried Qt for that directory, but alas, you have to venture into the bowels of Windows:
@
#include "shlobj.h"
@then:
@
TCHAR szPath[MAX_PATH];
SHGetFolderPath(NULL,CSIDL_COMMON_APPDATA,NULL,0,szPath);
QString sCommonAppData = QString::fromWCharArray(szPath);
@
3/4