Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can't find ProgramData folder for windows.
Qt 6.11 is out! See what's new in the release blog

Can't find ProgramData folder for windows.

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nikitablack
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nikitablack
        wrote on last edited by
        #3

        That's right, no one.

        1 Reply Last reply
        0
        • hskoglundH Offline
          hskoglundH Offline
          hskoglund
          wrote on last edited by
          #4

          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);
          @

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved