Is there a difference between %USERPROFILE%\Desktop and %SYSTEMDRIVE%%HOMEPATH%\Desktop\ that the path would be correct on Windows versions from Windows XP? I saw somewhere that there are 2 desktop folders on a computer, one Desktop and the other Рабочий стол . And they are different, one is empty and the other is not. What does it mean? How to correctly specify the path to the desktop, regardless of the OS version and other things?
While getting the path System.getenv("USERPROFILE") . It turns out C:\Users\User . I do not know whether it will work everywhere.
I wrote it like this, since in Windows XP, on which I just checked the folder was called Рабочий стол
Path ADRESS = Paths.get(System.getenv("USERPROFILE") + "\\Desktop"); if(Files.exists(ADRESS)) { \\ } ADRESS = Paths.get(System.getenv("USERPROFILE") + "\\Рабочий стол"); if(Files.exists(ADRESS)) { \\ }