1

I need a folder guarantees the logged in user has write access to , currently I use roaming profile folder but the client doesn't want me to use that folder anymore, is there any other folder I can use or is there a list of folders I can chose from?

note: ideally I dont want to use the %temp%

Thanks in advance.

hmjd
  • 120,187
  • 20
  • 207
  • 252
Yuan
  • 2,690
  • 4
  • 26
  • 38
  • What are you using it for? Temporary files or persistent (permanent) files? – Ken White Feb 01 '12 at 23:29
  • Do you mean you currently use the roaming profile folder or the roaming application data folder? If the latter, why does the client not want you to use it? – Harry Johnston Feb 02 '12 at 02:02
  • All explained in my answer here: [Does Windows 7 have the same problem as Vista?](http://stackoverflow.com/questions/5210575/does-windows-7-have-the-same-problem-as-vista) – Cody Gray - on strike Feb 02 '12 at 04:10

2 Answers2

0

Use the local (non-roaming) AppData folder.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
0

You should use SHGetFolderPath with CSIDL_LOCAL_APPDATA if your app needs to run on pre-Vista systems, and SHGetKnownFolderLocation with FOLDERID_LocalAppData if you're running only on Vista and later.

In either case, your application should create a folder under the returned location, and store your user-specific information in that folder.

Ken White
  • 123,280
  • 14
  • 225
  • 444