Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where to Locate data file for application on install?

Status
Not open for further replies.

Amesville

Programmer
Oct 10, 2011
93
US
Hi Folks

Hoping for a little advice. I have a VB.NET 2008 application I've been working on for a number of years, and finally it's almost ready to be released. I'm trying to figure out, though, where I can place my data file where I can have both read and write access to it and where it won't be wiped away by an over-zealous cleaner program.

In the old days (XP) I would have just located the file in the application folder along with the executable. But it seems now that files located there no longer have write access which pretty much negates the use of that location.

So what is left to me? I have been doing a little research, I found some info on the ProgramData folder but also found several statements saying not to use this folder. I looked into the AppData folder options but apparently these aren't meant as a permanent location, and data in them can be swept out by cleaner programs.

So I ask, what would you do? Where is a safe place I can place my data files where it will have read and write rights?

Thanks

Craig
 
%APPDATA% is the default location for data that is user specific

%PROGRAMDATA% is default location for data that is global (same for all users)

Configuration data should be kept in the registry HKLM for global, HKCU for user specific.


Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top