These are the steps I followed to optimise C drive space utilisation. I had done a clean install of Windows 10 on my iMac few months ago before changing it back to macOS again. My iMac has a fusion drive and I installed Windows into the SSD which is only 121 GB. C partition quickly started filling up. These days everything goes under C:\Users folder. My D: drive is on the HDD which is 2TB.

  1. Move C:\Users to D:.
  2. Change Windows Store app install location.
  3. Change default installation location on Windows.

Move Users Directory to Another Partition in Windows

1. Create a file called relocate.xml in D: with the below content.

<?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>

2. Run the below command as administrator.

%windir%\system32\sysprep\sysprep.exe /oobe /reboot /unattend:d:\relocate.xml

Make sure that Windows update is paused and rebooted. Else it will give the error "Sysprep was unable to validate your Windows installation". This can be caused for other reasons also.

It will take around 10 minutes to show the Windows configuration step. We have to create a new user account during this process. We can create a dummy account for this. Once done, we can log out of the new account and log in to the existing accounts and remove the dummy account.

Change Windows Store app install location

1. Go to Settings > System > Storage > Change where new content is saved.
2. For New apps will save to: choose D: drive.

Change Default Installation Location On Windows

1. Open Registry Editor and navigate to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion

2. For ProgramFilesDir and ProgramFilesDir (x86) change it to new path and reboot.

This will make Edge shortcuts to not work. From App Uninstall menu for Edge choose Repair. This will install Edge to the new location in D:. Copy the remaining folders EdgeUpdate and EdgeWebView from C:\Program Files (x86)\Microsoft to the corresponding directory in D:.

3. Open Run and run the below command

D:\Program Files (x86)\Microsoft\EdgeUpdate\MicrosoftEdgeUpdate.exe /regserver

This did not fix the "An error occurred while checking for updates: We couldn't create that component (error code 3: 0X80004002 -- system level)." This issue exists for Chrome also.

Edge Version 120.0.2210.133 (Official build) (64-bit)
Chrome Version 120.0.6099.217 (Official Build) (64-bit)

4. Open Command Prompt as administrator and run

sfc /scannow

This will fix any corrupt files.