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 r开发者_如何学Pythonesult 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
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
精彩评论