Get current user directory and roaming folder of Windows OS in Java

 To get current user directory and roaming folder of Windows OS in Java use the below:

String userHome = System.getProperty("user.home"); // Get the user's home directory
String roamingFolder = userHome + "\\AppData\\Roaming"; // Construct the roaming folder path

Comments