Search code examples
javawindowsspecial-folders

Java api to get Microsoft Windows Special folders


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.


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.