Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 328043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:27:29+00:00 2026-05-12T09:27:29+00:00

My application is currently storing settings in an INI file under the current user’s

  • 0

My application is currently storing settings in an INI file under the current user’s profile ( C:\Documents and Settings\<CurrentUser>\Application Data\MyApplication\MySettings.ini under WinXP). But I’ve realised some of these settings are unique to the machine not the user and thus want (actually need) to save them in a single location for all users.

Is there a folder location on Windows XP (and up) where I can store user independent settings?

NOTE: I don’t want to store them in the same folder as my application nor do I want to store them in the registry.

I notice there is an “All Users” folder under “C:\Documents and Settings\”? Should I be storing under there?

Bonus Points: I’m more likely to award the answer to whoever can also tell me how to return this path from Windows in Delphi 7.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:27:30+00:00Added an answer on May 12, 2026 at 9:27 am

    For XP, Windows provides SHGetFolderPath() to get a known location. The CSIDL that you’re looking for is CSIDL_COMMON_APPDATA, described as:

    The file system directory that contains application data for all users. A typical path is "C:\Documents and Settings\All Users\Application Data". This folder is used for application data that is not user specific. For example, an application can store a spell-check dictionary, a database of clip art, or a log file in the CSIDL_COMMON_APPDATA folder. This information will not roam and is available to anyone using the computer.

    For Vista and later, this has been replaced with SHGetKnownFolderPath() although SHGetFolderPath() is still available as a wrapper function for that. If you use the real Vista call, you should use FOLDERID_ProgramData instead of CSIDL_COMMON_APPDATA.

    This link here seems to show a way of doing it.

    It seems to boil down to this (treat this with circumspection, I don’t know Delphi that well):

    function ShGetKnownFolderPath (
        const rfid:   TGUID;
        dwFlags:      DWord;
        hToken:       THandle;
        out ppszPath: PWideChar): HResult;
    var
        Shell: HModule;
        Fn: TShGetKnownFolderPath;
    begin
        Shell := LoadLibrary ('shell32.dll');
        Win32Check(Shell <> 0);
        try
            @Fn := GetProcAddress (Shell, 'SHGetKnownFolderPath');
            Win32Check (Assigned (Fn));
            Result := Fn (rfid, dwFlags, hToken, ppszPath);
        finally
            FreeLibrary (Shell);
        end;
    end;
    

     

    function GetKnownFolderPath (
        const rfid: TGUID;
        dwFlags:    DWord;
        hToken:     THandle): WideString;
    var
        buffer: PWideChar;
        ret: HResult;
    begin
        ret :=ShGetKnownFolderPath (rfid, dwFlags, hToken, buffer);
        OleCheck (ret);
        try
            Result := buffer;
        finally
            CoTaskMemFree (buffer);
        end;
    end;
    

    This page provides a list of all the CSIDL_* and FOLDERID_* values. Keep in mind you should be using these functions for your user-specific data as well, not hard-coded values like "C:\Documents and Settings\<CurrentUser>\Application Data\". It may be that different language versions of Windows use different directory names or it’s possible that users can freely move their data areas around.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a console application and am currently storing some settings data in the
My application uses a settings file settings.txt to save the currently set values of
In an application where users can belong to multiple groups, I'm currently storing their
Our application currently stores bunch of configuraton & application specific data to files on
My Application currently serves requests for data, and can order the data to the
For my application, I am storing a url in a settings panel so the
I have a legacy application which is (currently) using Django to effectively display data.
I am currently developing a C# application to search a file in the computer.
An application currently in development has the requirements for using MS Word to perform
I have an application (currently written in Python as we iron out the specifics

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.