When I run System.getProperty("user.home")
on turkish windows 7, I get "C:\Users\aaaa" even though "Users" folder does not exist in my computer (I have the turkish translation of "users"). How can I get the correct user.home information?
Thank you
views:
59answers:
2On which version of Windows are you running? On Vista and above (2008, 2008R2, Windows7), the folder is called "Users" in teh file system, irrespective of the current language. But Windows Explorer displays it in the language of the UI, "Benutzer" (German) in my case. You can check in a command window that the real name of this folder is "Users".
even though "Users" folder does not exist in my computer (I have the turkish translation of "users").
That's not true. You have the "Users" folder. Windows just automatically translates it when displaying it. But you have to use "Users" for filesystem paths, which is what user.home
returns. The localized name is only relevant for displaying it to the user. I'm not sure how to get it from Java code.
Frankly, I think the whole concept of displaying different folder names to the user than what is actually present in the filesystem is a bizarre perversion.