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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 226k
  • Answers 226k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer EF4 is part of the .NET 4 / Visual Studio… May 13, 2026 at 1:14 am
  • Editorial Team
    Editorial Team added an answer If your PHP is outputting JavaScript, you'll need to break… May 13, 2026 at 1:14 am
  • Editorial Team
    Editorial Team added an answer One obvious way would be to "declare" it as integer… May 13, 2026 at 1:14 am

Related Questions

My application is currently storing settings in an INI file under the current user's
I'm a little confused on creating a DependencyProperty for properties that depend on external
I believe several of us have already worked on a project where not only
I have an C# dll project for which I have to store the runtime
I currently use log4net with a RollingFileAppender. As each Log call is made I'd

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.