Solved

Where to store data and settings for ALL USERS in a roaming profile environment?

Posted on 2006-10-27
5
263 Views
Last Modified: 2013-12-23
I am going to be deploying a custom application on a clients network.
The application requires access to both User specific data and global
data that needs to be available to all users whoever they are and
wherever they log in (with their roaming profile).  The User Specific info I am storing in:

Documents and Settings\[UserName]\Application Data\MyCustomApp\

As I understand - that will be available to a given user no matter what workstation they log in on.

But how about "All User Data"
Is the same:

Documents and Settings\All Users\Application Data\MyCustomApp\

Folder available to all users no matter where they log in? All users will need to be able to read and write into that directory.  

If that is not the case, what IS the proper way to handle data that needs to be commonly available and shared by all users of an application?  And if it is not the return from the API call ShGetSpecialFolderPath with a CSIDL_APPDATAALL ($0023) What IS the proper call to get to the right place to read and write such data?  

0
Comment
Question by:DMTrump
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:DMTrump
ID: 17824127
Is this so difficult?  In that case, I've increased the point value.

Or is it so simple you don't think it's worth answering?  

If you can give me the answer to this question - please do - earn some points!  

I need to know because I do not have access to a server based Windows network from my development system and I need to have the correct method in place before traveling to my clients site.
0
 
LVL 84

Expert Comment

by:oBdA
ID: 17825299
To start with, do NOT, never, ever, use a hardcoded "Documents and Settings\[UserName]" to access a user's profile. Either use the environment variable %Userprofile%, or use the proper API call to retrieve the user's profile path. Neither "C:\Documents and settings" nor the user profile folder name is a given.
For a user's application data, there's another environment variable %AppData%, and likely a matching API call.

Now, as far as the global settings are concerned, it won't help you anything to store that locally. A roaming user profile is *user* specific, so all that will be roaming is the user's profile folder. Apart from that, how would you share this data network wide if it's stored locally on the machines?
If this data needs to be available for all users at all times, it has to be stored i a network share, not on the machines.
0
 

Author Comment

by:DMTrump
ID: 17825703
Thanks - and your reminder to not use hard-coded paths may help someone else - but I was not doing that anyway.  I'm using the returns from the API call ShGetSpecialFolderPath.  Using a CSIDL_ constant for each path I need.

My question phrased more simply is: Does the path returned by ShGetSpecialFolderPath with  CSIDL_APPDATAALL  point to a directory on the network or is it transfered to the user when his or her profile is loaded?  I sounds as though it is the later.  So I need a call to find a read/writable place on the network.  Is there a CSIDL_ constant that can find that for me?

So you've answered half my question - Now I need method to reliably find a share drive on the network.  Or maybe that can't be determined from a User's computer and has to be set by the network admin seperately for each installation of the application?
0
 
LVL 84

Accepted Solution

by:
oBdA earned 250 total points
ID: 17825738
The network path for the common data is something that should be configured in the application settings, so that the administrator can decide where to put it (and change it later on, if the server moves or whatever).
AppDataAll is a common path for all users on a workstation, and it's (usually) a local path on the workstation; as I said, this is *NOT* part of any roaming profile, and it's of no use for data that should be available network wide.
0
 

Author Comment

by:DMTrump
ID: 17825773
Thanks!  

I also found a much more thorough list of CSIDLs that help explain what I needed to know at
http://tinyurl.com/7hei 
There is for instance a:
CSIDL_NETWORK (0x0012) A virtual folder representing Network Neighborhood, the root of the network namespace hierarchy.
But nothing specific for a commonly accessable work space.  As you said - that is something that seems to be a destination that the Admin must supply to each instance.

I <MUST> get a server based network set up for myself so I can learn more about this stuff!



0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A brief overview to explain gateways, default gateways and static routes OR NO - you CANNOT have two default gateways on the same server, PC or other Windows-based network device. In simple terms a gateway is formed when a computer such as a serv…
This is the first one of a series of articles I’ll be writing to address technical issues that are always referred to as network problems. The network boundaries have changed, therefore having an understanding of how each piece in the network  puzzl…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question