You are here

redirect any %appdata% to ./ possible?

3 posts / 0 new
Last post
jps
Offline
Last seen: 15 years 6 months ago
Joined: 2007-06-09 13:23
redirect any %appdata% to ./ possible?

I really dislike the documents and settings folder. Over years more and more cruft is inside. It`s complex and difficult to clean up.

Is there some common way to redirect any request of an application to write to %appdata% to /programfolder/username?

That way software would be already much more portable and I could delete all files of applications I am no longer using.

Jimbo
Offline
Last seen: 4 years 8 months ago
Joined: 2007-12-17 05:43
Probably not :(

The first problem is that many / most programs don't actually use the environment variable %APPDATA% to find the path to the settings storage. There are (at least) three ways to get it.

  • Read the environment variable
  • Use a windows API call
  • Read it directly from the registry

The second and third of these are both global settings, so would apply to all calling apps with the same answer, so you couldn't control what value each app got, so it would interfere with installed apps as well as portable ones.

Also, setting it to "./" would not have the results you are expecting. That would set the settings folder to be the current working directory at the time you tried to open the file, which could happen many times during an apps execution, for example read at startup, then reopened to write when you save the settings, possibly to a different place.

Also, ./ would frequently not actually be the app's folder, but could be.... the CWD of the launcher, the folder of the most recent document opened, some other folder that the app has cd'd into for some reason, etc.

This, sadly, is why some of the launchers here still have to copy the setting into and back out of %APPDATA% each and every time you run the application, which can be problematic if, for example, there is an installed version of the same app, or if the settings data becomes large.

jps
Offline
Last seen: 15 years 6 months ago
Joined: 2007-06-09 13:23
I thought there is maybe

I thought there is maybe some application to redirect any calls for %appdata% for specific applications.

Log in or register to post comments