redman
redman

Reputation: 1521

"Correct" location for Windows service data?

Since a Windows service doesn't run within a user context, what is the "correct" place to put writable data? Is there such a location that is version-independent (I'm thinking Vista vs XP)?

Upvotes: 0

Views: 245

Answers (2)

Aaron
Aaron

Reputation: 9193

A folder off the AppData folder - use SHGetFolderPath() and get the CSIDL_APPDATA path.

Actually - a service should use CSIDL_COMMON_APPDATA.

Upvotes: 3

Jon Seigel
Jon Seigel

Reputation: 12401

What kind of writable data?

Normally, an application would use either a database or a flat file for actual data. For error messages and the like, use the Event Log.

Upvotes: 0

Related Questions