5

Basically, the problem goes like this:

I own a Windows 10 PC with 32 GB EMMC storage which caters to my need of sending mails, doing basic typing etc. There is a slot to insert a MicroSD card (D:\) and I use a 128GB card in there to store files. I install all the programs in it, from MS Office to Adobe Reader. Since the C:\ drive is only 32GB, not much of the space is left in it (90% of it is full). So, I want to move the C:\Users folder to the D:\ drive to free up some space.

Little background about the C:\Users folder:

It is around 5.5 GB in size as can be seen below after making all the hidden files visible:

enter image description here

Thus, if I manage to send it to another drive, I will be getting a lot of space in C:\ afterwards.

So, for this purpose, I started searching for similar things in SuperUser. Most of them are asked years ago, for Windows 7 or 8, so please consider this situation if you think this question is a complete duplicate of some other questions.

On my quest, the first thing that I have come across is this:

Moving pre-installed MS Office to another drive

I have used this trick (which involves usage of symbolic links) to move my MS office to the external D:\ drive, but I am not sure if this method will work for moving C:\Users or not.

The next thing that I came across is this:

permanently move the c:\Users folder to another partition in windows 7

But, the question had been asked in the year 2011 and is closed now. The concerned OS in this question is obsolete Windows 7. So, I am afraid of running into problems after following the provided solution.

So, can anyone tell me if moving C:\Users to D:\ drive is possible or not and how it is to be done? Also, what are the risks associated with moving C:\Users to another drive? And, will it impact if I upgrade my current Windows 10 version in future?

PS: Before anyone asks me why am I on such an old version of Windows 10, I would like to tell that I am on Windows 10 v1709 because I can't upgrade to newer version due to lack of space :(

7
  • Yes; Windows does not like it when the user profile is on another partition. There were also issues with certain versions of Windows 10 when there was a non-standard user profile configuration. This question is a duplicate of this question by the way. Changing the location of the user profile will NOT move the data though. You have to do that yourself manually once the profile directory has been moved.
    – Ramhound
    Aug 15 '20 at 6:23
  • Okay, I might've missed that question. Thank you for pointing it out. By the way, can you suggest me some other ways to free up a chunk of space?
    – Sanu_012
    Aug 15 '20 at 6:43
  • Also, I noticed one thing that I am not able to understand. I installed Adobe Acrobat DC in D:\ drive, but a folder named Adobe still exists in C:\Program Files (x86)\Common Files\Adobe and takes up around 600 MB space. And what's worse is that I can't even move it using symlinks to D:\.Why is it so?
    – Sanu_012
    Aug 15 '20 at 6:50
  • You have not provided any information about what is taking all your storage. Provide that information
    – Ramhound
    Aug 15 '20 at 7:24
  • What I can tell you is that based on a 32 GB system drive. It’s very unlikely you will be able to make enough room to perform the upgrade.
    – Ramhound
    Aug 15 '20 at 7:26
2

I came across a tutorial on tenforums.com, the "Method 2" described suggests to:

  1. Create an unattended answer file, save this as eg. D:\relocate.xml
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
  <settings pass="oobeSystem">
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <FolderLocations>
        <ProfilesDirectory>D:\Users</ProfilesDirectory>
      </FolderLocations>
    </component>
  </settings>
</unattend>
  1. Run sysprep

Run this from a local administrator account using a run-as-administrator powershell or cmd-prompt.

%windir%\system32\sysprep\sysprep.exe /oobe /reboot /unattend:d:\relocate.xml
  1. Windows will reboot, moving your C:\Users to D:\Users and updating itself to work with the new location.

There is a supporting video and better explanation on the site and many people saying that this worked for them.

Microsoft article Relocation of the Users and the ProgramData directories to a drive other than the drive that has the Windows directory supports this approach.


My Experiences

I tried as above and my PC spent all night rotating balls at a cyan windows icon after reboot, doing something on the disk, but never completed. Power off and on came to the same place but showed a dialog:

"Windows could not complete the installation. To install Windows on this computer, restart the installation."

I tried the following, eventually succeeding:

  • Convert C drive from MBR to GPT (caused scary issues with recovery at first) because I thought I might need more than 4 partitions
  • Removed graphics card and used built-in graphics (fixed frightening blank screen after GPT/UEFI switch)
  • Removed Linux Subsystem (something suggested AppData/.../lxss files might be causing an issue)
  • Uninstall VirtualBox (one sysprep attempt gave an error suggesting it was incompatible)
  • Cleared out some space on C:\ and move the relocated "My *" directories back to C:\Users\Ed
  • Disobey the note just above the video on Method 2 "With Windows 10 version 1703 and later you do not have to disable existing users as shown in video...might even lock you completely out from Windows" - this succeeded.

I either restored C: from the backup I'd made according to the instructions elsewhere on the site or moved a small step forward each time.

Conclusion: It works, but you need to be careful with backups. Persistence will pay off.

1
  • 1
    For those who like me were exhausted and didn't understand why their relocate.xml was corrupt, do check that the case of your xml tags inside the file is correct.
    – SebMa
    Nov 3 '21 at 20:42
1

I have done this a number of times with same reasoning, 30-64 GB SSD with secondary drive (HD or SSD) and running out of space on the drive.

Moving the 'user' data is easy (can do this in Windows) easily, Desktop, Documents, Music etc (just right click and drag to a new location) then log off the user and log back in. This is probably not what you are seeking. The hidden apps folder, registry etc are harder to move as noted in previous responses.

Your running low on space issue could be not the user profile, but Windows 10 downloded apps taking up gigs of space. We found on a 60GB SSD that 32GB was Candy Crush, and other junk games that were not actually installed.

These are in the C:\Program Files\WindowsApps\ folder. You may look there and see if you find multiple copies of install files. If you do, you can remove them via Powershell remove-app command, then remove the folders.

0

Yes, we can move user profiles by automating the whole process through a Powershell script. First create a temporary administrative account. And then run this:

$ProfilePaths = Get-ChildItem "REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" | 
  Where-Object {$_.Name -match "^S-1-5-21*"} | 
    Select-Object -ExpandProperty Name -Skip 1 | Foreach {
      (Get-ItemProperty "REGISTRY::$($_)" -Name "ProfileImagePath").ProfileImagePath
    }
$ProfilePaths = $ProfilePaths | Where-Object {$_ -ne "C:\Users\$($env:Username)"}
$ProfilePaths | Foreach {
  $Current = "$_"
  $Move = $_ -replace "^C:","D:"
  Move-Item -Path "$Current" -Destination "$Move"
  $User = New-Object System.Security.Principal.NTAccount("$(Split-Path "$Current" -Leaf)")
  $SID = $User.Translate([System.Security.Principal.SecurityIdentifier])
  Set-ItemProperty "REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$($SID.Value)" -Name "ProfileImagePath" -Value "$Move"
}
Move-Item -Path "C:\Users\Default" -Destination "D:\Users\Default"
Set-ItemProperty "REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" -Name "Default" -Value "D:\Users\Default"
Move-Item -Path "C:\Users\Public" -Destination "D:\Users\Public"
Set-ItemProperty "REGISTRY::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" -Name "Public" -Value "D:\Users\Public"

What the script does:

  • Moves all profiles first
  • Then sets a value in Registry to make windows notify of the new location

Run this from the temporary administrator account

Unfortunately, you can't move C:\Users but bulk move all user profiles.

5
  • 1
    Any risk associated with it? Because everyone till now is suggesting me not to do it.
    – Sanu_012
    Aug 15 '20 at 9:27
  • I have shown you to move all userprofiles from C:\Users, not the full directory itself. Moving whole C:\Users is unsafe, but moving individual profiles are safe. Because AppData goes with them and ProgramData remains untouched. Aug 15 '20 at 9:31
  • What is meant by all individual profiles? And I don't know how to create a temporary admin account too :(
    – Sanu_012
    Aug 15 '20 at 9:34
  • Individual profiles mean the script moves all the user folders inside C:\Users Aug 15 '20 at 9:37
  • How does this not break the hard links in every %UserProfile%?
    – JW0914
    Feb 21 '21 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.