[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Database and common setting files location

Posted on 2011-10-16
2
Medium Priority
?
283 Views
Last Modified: 2013-11-26
I have a .NET application that uses SQL Server Express. The application automatically creates a database file on first run (after installation) and creates a full backup every day. The application also creates/loads setting/data files which applies for all users.

Note that the application must not need administrative privileges to work.

I have googled a little and found a few folders (Win7), but I'm not sure which one to use
"C:\Program Files\Common Files"
"C:\ProgramData"
"C:\Users\All Users"

What is the difference between the 3 and when should I use them? The folder (or its equivalent in .NET code) used must be available regardless of the OS (WinXP and above).

TIA
0
Comment
Question by:Thomasian
2 Comments
 
LVL 22

Accepted Solution

by:
pivar earned 2000 total points
ID: 36978333
Hi,

Have a look at http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx. You can read how you grab the location for the different folders and what to store there.

But in short:

"C:\Program Files\Common Files" (CommonProgramFiles): The directory for components that are shared across applications.

"C:\ProgramData" (CommonApplicationData): The directory that serves as a common repository for application-specific data that is used by all users.

"C:\Users\All Users": Link to the folder C:\ProgramData.

If you have user specific data, you can use ApplicationData or LocalApplicationData.

Also, the Users and ProgramData folders are new in Vista, earlier it was "C:\Documents And Settings" and "C:\Documents And Settings\All Users\Application Data"

/peter
0
 
LVL 22

Author Closing Comment

by:Thomasian
ID: 36978380
Thanks
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
MS Outlook undoubtedly is the most widely used email client.Its user-friendliness, cost effectiveness, and availability with Microsoft Office Suite make it the most popular email application.  Its compatibility with Microsoft applications like Exch…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Suggested Courses

873 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