Hi,
I am developing some application for windows vista (earlier it was running fine on XP). There were number of issues related to UAC and other new security features which i have gone across. However, there is one thing which is still confusing to me.
There are some files that i want to write in some place which should be shared by all users. Where should i write those files?
http://msdn2.microsoft.com/en-us/library/bb206295.aspx#Setting_the_Execution_Level_in_the_Application_Manifest
From the above article i came to know that there is one folder which is accessible by all users and that is:
CSIDL NAME: CSIDL_COMMON_APPDATA
Typical Path : C:\ProgramData
Standard User Rights: Read/Write if owner
Access Scope: All Users
It's fine that we can write files to it. but my application needs to *READ* and *WRITE* as well. so suppose if some file
a.xxx is writen by user1, I need a workaround or location which should allow me to read/write that
a.xxx file from ANY USER.
-
-
The correct behaviour in those circumstances is to create a subdirectory under CSIDL_COMMON_APPDATA and apply appropriate* ACLs such that it can be read/written to as needed.
You do, however, also need to consider how your application arbitrates access to such shared files given that multiple users might be running your program simulataneously (Fast User Switching, Secondary Logon, Terminal Services etc)
*Appropriate in these circumstances is usually to grant the Users group Modify permissions -
Have you considered SpecialFolder.CommonApplicationData ?
(I'm assuming you are using .NET) -
CSIDL_COMMON_APPDATA is the same thing as SpecialFolder.CommonApplicationData, so you'd still need the ACLs.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.