From: Viv on
Hi all,

I have an application that uses one configuration file which should be
the same for all users. This conf file should also be editable by any
user.

1) For Win2000 and WinXP it was not a problem to use the
SHGetFolderPath function with CSIDL_COMMON_APPDATA which would then be
smth like: "C:\Documents and Settings\All Users\Application Data" and
to put there the conf file for my application.
The problem is that on Vista the call of
SHGetFolderPath/SHGetKnownFolderPath with CSIDL_COMMON_APPDATA gives
the: "C:\ProgramData" directory which is read-only and _hidden_. If I
put the conf file there the users won't be able to modify the conf
file because it's a hidden directory. Is there any other place
recommended by Microsoft where one could put the application data that
is not _user_ specific and it's not _hidden_?

2) As a possible solution to the above problem I was thinking of using
the CSIDL_COMMON_DOCUMENTS. It doesn't sound right to me, but it's the
only way out that I found until now. What makes me wonder is that if I
print the return value of SHGetFolderPath/SHGetKnownFolderPath with
CSIDL_COMMON_DOCUMENTS I get: "C:\Users\Public\Documents" even though
in windows explorer is no such directory, it's only the "Public
Documents", I mean: "C:\Users\Public\Public Documents". Why is this
confusion between "C:\Users\Public\Documents" and
"C:\Users\Public\Public Documents"?

Thank you in advance,
Viv
From: <.> on
C:\Users\Public\Documents is the name of the folder. This folder uses a
desktop.ini for display name purposes. In English it is Public Documents.

--
..
--
"Viv" <vcotirlea(a)hotmail.com> wrote in message
news:fbopo5pfvcfdembjn0jf71d9t3fmt4cmk7(a)4ax.com...
> Hi all,
>
> I have an application that uses one configuration file which should be
> the same for all users. This conf file should also be editable by any
> user.
>
> 1) For Win2000 and WinXP it was not a problem to use the
> SHGetFolderPath function with CSIDL_COMMON_APPDATA which would then be
> smth like: "C:\Documents and Settings\All Users\Application Data" and
> to put there the conf file for my application.
> The problem is that on Vista the call of
> SHGetFolderPath/SHGetKnownFolderPath with CSIDL_COMMON_APPDATA gives
> the: "C:\ProgramData" directory which is read-only and _hidden_. If I
> put the conf file there the users won't be able to modify the conf
> file because it's a hidden directory. Is there any other place
> recommended by Microsoft where one could put the application data that
> is not _user_ specific and it's not _hidden_?
>
> 2) As a possible solution to the above problem I was thinking of using
> the CSIDL_COMMON_DOCUMENTS. It doesn't sound right to me, but it's the
> only way out that I found until now. What makes me wonder is that if I
> print the return value of SHGetFolderPath/SHGetKnownFolderPath with
> CSIDL_COMMON_DOCUMENTS I get: "C:\Users\Public\Documents" even though
> in windows explorer is no such directory, it's only the "Public
> Documents", I mean: "C:\Users\Public\Public Documents". Why is this
> confusion between "C:\Users\Public\Documents" and
> "C:\Users\Public\Public Documents"?
>
> Thank you in advance,
> Viv

From: Viv on
Thx for your answer to my second question. Understood.

Any clue about my first question?

Thx,
Viv ;)

On Wed, 3 Mar 2010 12:20:10 +1100, <.> wrote:

>C:\Users\Public\Documents is the name of the folder. This folder uses a
>desktop.ini for display name purposes. In English it is Public Documents.
>
>--
>.
From: <.> on
Read only on a folder means for explorer to treat the folder specially. Note
it does not mean read only on a folder. Anyway the folder isn't read only
but ordinary users don't have write access.

I don't have any solutions for you.
--
..
--
"Viv" <vcotirlea(a)hotmail.com> wrote in message
news:hn9cp5p9pae75539ihrlht3leoc6m7g1n0(a)4ax.com...
> Thx for your answer to my second question. Understood.
>
> Any clue about my first question?
>
> Thx,
> Viv ;)
>
> On Wed, 3 Mar 2010 12:20:10 +1100, <.> wrote:
>
>>C:\Users\Public\Documents is the name of the folder. This folder uses a
>>desktop.ini for display name purposes. In English it is Public Documents.
>>
>>--
>>.

From: Leslie Milburn on
But I do.....

It is a bad idea to allow users to directly modify config files becuase you
have no control over what occurs. What is a better idea is to create your
own cfg.exe which captures the user input and updates the config file
itself. Therefore placement of the file become irrelevant and in fact is an
advantage in an enviornment with a mixture of different versions of windows
due to the folder names being different.

hth
Leslie.


<.> wrote in message news:OKicFg3vKHA.3564(a)TK2MSFTNGP05.phx.gbl...
> Read only on a folder means for explorer to treat the folder specially.
> Note it does not mean read only on a folder. Anyway the folder isn't read
> only but ordinary users don't have write access.
>
> I don't have any solutions for you.
> --
> .
> --
> "Viv" <vcotirlea(a)hotmail.com> wrote in message
> news:hn9cp5p9pae75539ihrlht3leoc6m7g1n0(a)4ax.com...
>> Thx for your answer to my second question. Understood.
>>
>> Any clue about my first question?
>>
>> Thx,
>> Viv ;)
>>
>> On Wed, 3 Mar 2010 12:20:10 +1100, <.> wrote:
>>
>>>C:\Users\Public\Documents is the name of the folder. This folder uses a
>>>desktop.ini for display name purposes. In English it is Public Documents.
>>>
>>>--
>>>.
>