Skip to main content

Changing the Default Drive to Store User Profiles and Data from C to D in Windows 10

In this post we will look at how to change the default drive to store user data from C to another drive like D.
Login to the machine and copy the following code into a file called "relocate.xml" - preferably in D Drive.
[pre class="brush:bash"]
<?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="" xmlns:xsi="">
  • Open admin cmd
    [pre class="brush:bash"]net user Administrator /active:yes[/pre]
  • Create a password for the Administrator account if you are going to remote login
  • Sign out 
  • Sign into your admin account
  • Open admin cmd
    [pre class="brush:bash"]cd C:\Windows\System32\sysprep
    sysprep.exe /oobe /reboot /unattend:D:\relocate.xml[/pre]
  • This will reboot the machine and then you will have to setup an account
  • Open cmd as admin
    [pre class="brush:bash"]net user Administrator /active:no[/pre]
  • Sign out from the temporary account

You may also interested in reading: