When you mean operating file, then I guess you mean data files that belongs to your application. Such files should not be placed in the Windows-directory. What if another application suddenly decides to also use this location, and by mistakes uses your filename-format ? You should read this guide from Microsoft Data and Settings Management[^] (Though written for Win2k, then it also holds for Vista/Win7)
TCHAR szAppData[MAX_PATH];
...
hr = SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, szAppData);
PathAppend(szAppData, "Company\Product\File.txt")
CSIDL_APPDATA - Per user, roaming [user profile]\Application data
CSIDL_LOCAL_APPDATA - Per user, non-roaming [user profile]\Local Settings\Application data
CSIDL_COMMON_APPDATA - Hidden folder for normal users. Per machine (non-user specific & non- roaming) All Users\Application data
CSIDL_COMMON_DOCUMENTS - Visible folder for normal users. Default files in this folder is readonly for other users than the creator, the application must change the security permissions on its application-folder to change this behavior. Per machine (non-user specific & non- roaming) All Users\Documents
modified on Monday, December 14, 2009 10:39 AM