Monday, February 28, 2011

How to get the path to the desktop

You can use the following code to get the full path to the current user's desktop folder.

String desktopPath = System.getProperty("user.home") + "/Desktop";
System.out.print(desktopPath.replace("\\", "/"));

2 comments: