# Windows – How to move the home directory of current user into another place, in Windows XP

windows xp

Current, the home of current user is:

C:\Documents and Settings\freewind


It contains many other directories, e.g. My Documents, Desktop

Now I want to move the whole directory to another place, for example:

D:\freewind


Then if I want to run this Java code:

System.out.println(System.getProperty("user.home"))


It will print D:\freewind.

Is it possible?

• Java uses the %USERPROFILE% environmental variable, but if you want to move the home directory to some other folder or other drive, this is a bit tricky.

Here is a very well explained blog post about how to move the Windows User Profile to another directory, written by Keith Survell.

The idea is to use NTFS junction points. Here are the basic steps:

• Make a thorough backup
• Move the complete user's directory contents to the new folder, e.g. from C:\Users\JohnDoe to C:\JohnDoe. This can be done by just drag/dropping in Windows Explorer.
• Rename the old User directory to something else (e.g. JohnDoe.old)
mklink /J C:\Users\JohnDoe C:\JohnDoe