6

I want to relocate my user directory C:\Users\Edwin to a mapped network drive E: (i.e. mapped from a network share \\\\192.168.22.9\share).

The difficult part is in relocating the user directory itself. I found 2 possible solutions, both of which were not applicable to me due to my use of a network drive.

  1. Moving C:\Users\Edwin" to "E:\Users\Edwin and then use junction symlink (mklink -J) to link back to C:\Users\Edwin.

    This doesn't work for me because i can't create a junction symlink from a directory on a non-local drive.

  2. Changing the value of registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\ProfilesDirectory from %SystemDrive%\Users to E:\Users BEFORE creating the "Edwin" user.

    Thereafter, when "Edwin" user first logs in, the profile will be in E:\Users\Edwin.

The problem with this is that I run into a chicken-and-egg problem.

On first login as user "Edwin" the profile will be created in E:. However, at the moment I first login, the mapped network drive E: isn't there.

I've tried the following to no avail:

  1. Create a persistent mapped drive as Administrator. Didn't work. The mapped drive is only visible to the Administrator user.

  2. Create a persistent mapped drive using system rights (using PsExec -s). Didn't work. The mapped drive isn't "owned" by anyone, not even the current Administrator user.

  3. Create a persistent mapped drive using the newly created Edwin user, without logging in as Edwin yet (using PsExec again). Didn't work. While is possible to create a mapped drive as a different user, once i tried to do it persistently (/persistent:yes), i get a Access is Denied error.

Any idea how this can be done? Or whether it even can be done at all?

3
  • How about redirecting to the UNC path instead?
    – afrazier
    Dec 15, 2010 at 1:04
  • This is impossible. Windows constantly writes to the user profile, so performance would slow to a crawl.
    – kinokijuf
    Feb 7, 2013 at 13:00
  • Also, the kernel holds a lock on %USERPROFILE%\NTUSER.DAT (the registry) and this happens on a lower level than UNC.
    – kinokijuf
    Feb 7, 2013 at 13:02

5 Answers 5

5

This is a bad idea. The problem is mapped drives can vary per user, and so you don't know what mapped drive E: means until after you've already logged in and loaded your profile. You might get it working via UNC path (\\server\share), but I still don't recommend this for the whole profile.

A better alternative is either using Roaming Profiles (but IIRC that requires Active Directory) or mapping only specific folders (Documents, Desktop, etc).

3

I came here to find a solution to this problem, too. Your second suggestion actually answers the question that I came here with.

I also knew that it wouldn't work to just link the user folder to a network drive, because they wouldn't be available at login. I haven't done it yet, but I'm planning to combine this with Offline Files. That would give you the performance of your disk and also make your user directory available on slow links or when there isn't any network connection at all.

I know this issue is more than 2 years old, but I figured that maybe you are still interested.

I've also looked into Roaming user profiles, but decided against it due to its many flaws.

3

What you're trying to do is called folder redirection, and windows has native support for it. I've never done it on a stand-alone computer, but for a windows domain you can make it happen via GPO. That GPO changes a few registry keys, which should be quite doable manually.

That should automatically activate offline files, so you'll be able to access (a copy of) your home folder even when the share is unavailable.

This guy seems to have got it working.

Microsoft article about folder redirection in general.

Also, to copy a user profile, reboot, then login with another account with administrator privileges and use these instructions. (Not sure if it works exactly the same on windows 7, but the same button should be there somewhere.)

The chicken-and-egg problem should be quite circumventable by using a UNC path instead of E:.

2

I'd be interested to know why you would want this. Are you sure this would be a good solution to whatever you wanted to achieve, even if it were possible?

  • If it is in order to protect your privacy, why not just keep the user folder to a minimum? That is, run Firefox and whatnot from E:, make sure the cache folder is also on E:, and set any folders that those programs use, such as the Downloads folder, to E:. And set My Documents to some folder on E.

  • If it is in order to always have your personal data available at any place, why not set up a real-time backup to your E: drive? There are programs that can do this.

1
  • 2
    i am actually running Windows 7 in a VM, for security, and restoring a known-clean snapshot at the end of each use. However, i also want to persist user settings like desktop, firefox settings and bookmarks, etc. On top of that, the network drive i'm mounting is actually a NAS with raided HDDs to minimise data loss. i don't really understand, why is it a bad idea?
    – Edwin Lee
    Dec 16, 2010 at 13:08
0

My suggestion:

  1. Create the new user and log into the new account.
  2. Create the network mapping.
  3. Log off.
  4. Log into an administrative account.
  5. xcopy /s /h /g /k /o c:\users\Edwin* \\192.168.22.9\share\
  6. Registry edition:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\ProfilesDirectory
    
  7. Try to log into Edwin to see if it works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .