0

The application I am working with writes to the User\Application Data folder on XP and the AppData\Roaming folder on Vista. On one of the Vista machines the AppData\Roaming folder is not present. As a result some of the features of the application are not functioning. Have any of you encountered such a scenario before? I am not sure what to do in this case. Can I create the AppData\Roaming folder?

Thanks jbsp72

jbsp72
  • 1
  • 2
  • 2

1 Answers1

1

If you're hardcoding those paths, you should be using environment variables instead.

On the machine in question, open a command prompt (WinKey+R>cmd>Enter) and enter echo %appdata% and press Enter. It should return the application data path for the current user.

...oh, and to use environment variables, replace, for example c:\Program Files\MyProgram\data with %programfiles%\MyProgram\data

There are many lists of these available, on of which is at http://vistaonwindows.com/environment_variables.html

Jay
  • 56,361
  • 10
  • 99
  • 123
  • I am not hard coding the paths. I am reading them from the registry( If I am not mistaken even SHGetFolder() does that ). The path I am getting is AppData\Roaming but the folder is absent on the system. – jbsp72 Jan 22 '10 at 15:09
  • ...but the registry is telling your application that's the folder to use? Are there other users on that system, and do they have AppData\Roaming under their `:\Users` directories? How about the default user? – Jay Jan 22 '10 at 15:33
  • Does Vista have the alternate junctions, like Win 7, under `:\Users\\Application Data`? If so, can you get to, say, `:\Users\\Application Data\Microsoft`? – Jay Jan 22 '10 at 15:38
  • Yes, the registry is telling me the AppData folder is at AppData\Roaming but that folder is not present on the system? I don't have the machine with me one of the users reported this. I will get back to you regarding other users having AppData\Roaming – jbsp72 Jan 22 '10 at 15:42
  • Hmmm... now I'm curious about the user's report and whether this whole folder thing might be a red herring. How did he or she check for the folder? By default, it is hidden in Explorer. I would expect a lot more problems on the user's machine if the expected appdata folder really isn't there. – Jay Jan 22 '10 at 16:04
  • Kudos.. you are right! The guy who brought this to my notice didn't bother to check if the folder is hidden. The problem is something else entirely. Thanks – jbsp72 Jan 22 '10 at 16:23