views:

43

answers:

2

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)?

A: 

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.

Jon Seigel
It's user data, stored as flat text files, but not specific to a user.
oakskc
+3  A: 

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

Actually - a service should use CSIDL_COMMON_APPDATA.

Aaron
Perfect! Exactly what I needed.
oakskc