Question

I once found a nifty little library that used JNI to allow java applications on Windows to get the locations of various "special" directories on windows. I can't for the life of me find it again...

In particular, I need to get the location of the "All Users" (shared) "Application Data" directory.

So, anyone have a bullet proof way in Java to locate the "All Users" "Application Data" folder?

It needs to be bullet proof.

Was it helpful?

Solution

You could use the following property in the environment:
ALLUSERSPROFILE=C:\Documents and Settings\All Users

Edit: This no longer works as of Windows Vista and newer.

OTHER TIPS

You might want to research Environment Variables:

http://en.wikipedia.org/wiki/Environment_variable#DOS_and_Windows http://en.wikipedia.org/wiki/Environment_variable#System_path_variables

The System.getenv() method offers a list of the system's environment variables and it's included in the core library. Doesn't get much more bullet-proof than that.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top