How to extract the path "c:/documents and settings/user" using Java... Is there any method??
System.getProperty("user.home")
should be enough. See here for an example.
public class UserHomeExample
{
public static void main(String[] args)
{
System.out.println("User Home Path: "+ System.getProperty("user.home"));
}
}
Gives:
C:\convert\rajesh\completed>javac UserHomeExample.java
C:\convert\rajesh\completed>java UserHomeExample
User Home Path: C:\Documents and Settings\Administrator
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With