User Folder Relocation - drive letter changed / can't log in

  1. Posts : 2
    Windows 10 64 Bit

    User Folder Relocation - drive letter changed / can't log in

    Not sure if this is the best thread to post this in.

    Here's the scenario.
    You use the (amazing) folder relocation tutorial in this forum. The process succeeds and you have a wonderful stress free year in Windows 10. Then your motherboard fails and you replace it with a different brand. Suddenly, when you get booted back to Windows, you can't log in! You quickly realize it's because you set your 2nd hard drive to drive letter "D:", but when Windows reloaded the disk drives because of the hardware change, it assigned "D:" to the DVD drive, and now you are stuck!

    Fear not fellow tweakers, I put in the research and have the solution (this may be redundant from another post, tried to search originally but didn't find anything, so my apologies if duplicating).

    Quick detail: First, we are going to boot into the recovery console and use the command prompt. In the recovery console, please be aware that it uses a virtual drive "X:" as the OS drive. Your other drive letters will be changed. Then we will identify which drive letter your OS is installed on. Next we will find which drive letter your user profiles are loaded on. Then we will make registry edits to fix the drive letter changes. Finally a reboot and celebratory dance.

    Note: You will need an understanding of command line operations and registry editing. If you do not, please find that information first, I will assume you have this knowledge moving forward.
    Also, there are no screen shots. I'm sorry, I didn't think I would be posting this while I went through the process, therefore I have no screen shots to share. If anyone has to go through this, it would be great if you could share your experience and provide screenshots if available.


    Step 1: Boot into the Recovery Console and select the Command Prompt option.
    * If you don't know how, basic tutorial: Interrupt the boot cycle 3 times to activate the recovery consol. As the system boots, when you see the windows logo, simply do a hard reset. After 3 times, when the windows logo appears, it will say it is starting "Automatic Recovery". Once that is done, log in with the local admin account and it will (at least for me) automatically open a command prompt.
    * This can also be accomplished a number of other ways including the use of recovery drives, install media, etc.

    Step 2: If you are confident on which drive is likely which, you can skip to step 3. If not, you need to determine which drive is which in the registry. To do this you have to use a variety of steps.
    1. Find the original OS drive. In the command prompt, type the following command:
      bcdedit | find "osdevice"
      The command will return osdecice partition=*: where "*" will be the current drive letter.
    2. Now you need to find the drive that has the user profiles folder assigned, from your folder relocation. There are a few ways to do this, I will list one. Type "regedit" in the command prompt to open the registry editor.
    3. In the registry editor, navigate to HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices
    4. In this part of the registry you will see all the drive letters assigned to various volumes. From step 2a, you'll know which volume would be your normal "C:" drive. Write down the hex code associated with that drive letter. Next, you need to determine which drive letters represent volumes on physically mounted drives, and which represent removable media. Not getting too technical, basically you just look for all the volumes that have a hex code length equal to that of the OS drive.
      1. For example, if in step 2a you discovered that your OS drive is assigned the letter "W:", then look at the entry with that drive letter assigned. The number of hex entries represents a volume on a physically connected drive. Find all the other drive letters that have an equal number of hex entries. Those are all volumes on physically connected drives.
    5. Explore each of those drive letters to find the one with the user profile folder.
    6. Do this by typing "dir *:" in the command prompt, where "*" equals the drive letter.
    7. Go back to the registry editor (regedit). Find the "DosDrive" key entry with same drive letter as in step 2e. Write down the hex code for that key entry.

    Step 3: Before we can make the necessary registry changes, you need to connect to a different registry, called a "Hive".
    1. This link has a more expanded explanation of what we are about to do.
    2. In the key folder pane (left pane) of the Registry Editor window, highlight the "HKEY_LOCAL_MACHINE" option.
    3. Next, click on "File" and chose the option for "Load Hive"
    4. You'll have a familiar "open" window, navigate to the os drive found in step 2a.
    5. Navigate to the windows\system32\config folder
    6. Select the "SYSTEM" file option, and click "OPEN"
    7. It will ask for a key name. This is a temporary name and thus doesn't need anything official. Make it easy to remember. I used: "Drive Letter Change". Then click "OK"
    8. Now you will see an option under HKEY_LOCAL_MACHINE for "Drive Letter Change" (or whatever you named it in the previous step.
    9. Open that new folder and navigate down to
      HKEY_LOCAL_MACHINE\Drive Letter Change\MountedDevices
    10. This will look similar to what you found in step 2d, with the notable difference being this is what Windows will look like when not in recovery!

    Step 4: Make the registry changes
    1. Delete every registry entry that either starts with \\??\ OR has a hex code LONGER than the physical drives (Step 2d).
    2. You should be left with \DosDevices\ keys with equal length hex codes.
    3. Find the key with the hex code that matches with the OS drive you wrote down in step 2d. Make sure it is assigned the drive letter "C:"
      1. There should be no change in this
    4. Find the key with a hex code that matches your user folder drive, you wrote this down in step 2f.
    5. Right click that key name and chose the option for "Rename"
    6. Change the drive letter to whichever drive letter is needed for your particular setup.
      1. When I did my folder relocation initially, I had set my user folders to be found on the D drive. So on this step I renamed the key from "\DosDevice\E:" to "\DosDevice\D:"
    7. Confirm there are no duplicate or conflicting key entries: each drive letter will be used only once.
    8. *NOTE* For THIS particular set of keys (MountedDevices), you can safely delete everything thing. Windows will re-initialize these values at boot if it detects drives that are unaccounted for. So, if you delete everything besides the C drive and your user profile drive, that is OK! Windows will reconstruct the missing keys for you. Once you can log in, you can use Device Manager to change drive letters at will. This IS NOT TRUE for all registry items.

    Step 5: Close the registry editor

    Step 6: Type "exit" at the command prompt

    Step 7: Click on the button for "Turn off PC"

    Step 8: Count to 10, take a deep breath, and turn the computer back on

    Step 9: Log into windows

    Step 10: Assuming Step 9 worked, celebrate in your preferred method. If step 9 didn't work, double check you followed my instructions. If not, shut it all down and go to the beach!
      My Computer

  2. Gordon7's Avatar
    Posts : 182
    Win 10 rs1 - build 14393.1944

    @JediNemo - Hi and welcome to TenForum, from your post:

    "Once you can log in, you can use Device Manager to change drive letters at will. This IS NOT TRUE for all registry items."

    You can't change drive letters in Device Manager! This has to be don in Disk Manager as an ADMINISTRATOR!

    If you can log in to your PC, then simply run Disk Manager as Admin and change drive letters back to "original".

    This is much less complicated than your solution (that is if you can log in to your PC).

    In your case, it look like you have connected your HDD to the wrong plug, if that was the case it is possible
    to reconnect to the right plug (SATA connectors) and boot up again - log in a.s.o.
      My Computer

  3. Posts : 2
    Windows 10 64 Bit
    Thread Starter

    @Gordon7 - Thank you for the welcome.

    You are correct, I meant to say Disk Manager, thank you for catching that error. And, as this is my first post, I assumed people knew that these changes needed to be made with Administrator privileges. Anything I post in the future I will make sure to include this caveat.

    In regards to your simplified solutions, they didn't work in my situation, nor would they have. Perhaps I wasn't explicit enough in my original post, so let me provide a bit of additional explanation and background detail.

    I had used the folder relocation protocol found in this forum; wherein during Windows 10 installation I used sysprep to tell Windows to store all user folders to a different hard drive. During this process I also used Disk Manager (thank you again) to change my drive letter assignments. My rig has the following mounted drives (excluding USB attached): 1xSSD, 1xHDD, 1xBD-RW. I changed my drive letters to be SSD=C:, HDD=D:, and BD-RW=E:. When I created the unattended answer file, I told windows to move the user folders to the "D:" drive.
    When my motherboard failed last week, I replaced it with a different brand board. Windows, recognizing a major hardware change, immediately re-initialized and thus re-assigned the drive letter assignments. When that happened, my HDD was re-assigned the drive letter E:, and my BD-RW to drive letter D:. Now, after this happened, windows could no longer find the User Folders on drive D, and therefore refused any log in requests.

    This is where your simplified solution fails, as Windows rejected any log in request, I was unable know...log in. Therefore I had no access to the Disk Manager, nor any other system modification tools.

    In regards to swapping out the plugs, you should know that this wouldn't have made a difference. Windows assigns drive letters not based on the SATA port the drive is plugged into (parallel drives are different, which I gave insight on below), but by the unique device id's. Those device id's generate unique hardware id's for which Windows uses to reference the physical devices. Those hardware id's are then used to reference the volumes attached and drive letters are assigned thusly.
    Also, I tried to swap the plugs. I tried to disconnect the BD-RW drive. It didn't make a difference because Windows had already re-assigned the drive letters when it re-initialized. Once drive letters are assigned to these devices (FDD, HDD, Optical Drives), they are stuck unless changed by the user.

    Some windows tech and history. Ever since the earliest days of Windows, the programming had a "safe" default of drive letter assignments: A & B were reserved for removable media or floppy disks, C-Z reserved for fixed or hard disks. When CD's were introduced, Microsoft decided to assign optical media letter D, keeping C reserved for the operating system, and E-Z for additional hard disks. And then, of course when USB (or even serial) attached media was introduced, those were assigned a letter from the E-Z pool as needed. In fact, and please someone correct me, when Windows assigns drive letters, it follows these rules: 1) OS - C; 2) Floppy drives assigned A, B, E-Z as needed); 3) Optical Drives assigned D, then E-Z as needed); 4) Volumes (partitions) on hard drives - E-Z as needed; 4) Hot swappable media such as USB drives - E-Z as needed.
    While you can change assignments to nearly every option, save for the Operating System drive, Windows will always default to these rules. Furthermore, when windows detects a major hardware change, such as a motherboard replacement, it will actually delete any previously assigned drive letters and revert back to the default rules.

    SO...with all that information on hand. IF anyone else changes their drive letter assignments, putting your user folders on a partition assigned to the D drive; please know that if you ever have to swap out your motherboard you will need to go through this process. Unfortunately you can not just swap the plug placement, and as you can't log in, you wont be able to use any of the built in tools.

    Hopefully that cleared up the reason for this instruction post. If you guys don't find it helpful, that's fine. My situation was unique, and hopefully rare. But it happened and these steps are what was required to get back up and running without re-installing windows.

    Good luck out there.
    ~Chris (JediNemo)

    P.S. In regards to parallel drives, as an FYI. Any windows system 95 and above will follow these rules with regards to the optical drive being assigned D:, but hard drives are assigned letters in order based on their connection to the motherboard. In fact these old systems used to require the harddrive to be jumpered to a setting of master or slave. The Master Drive needed to always be connected to the #1 connector on the parallel cable, and the slave to the #2. These cables were plugged into parallel ports on the motherboard or expansion board, and those ports were also numbered. So the 1st drive seen by the system would be the one plugged into #1 connector on the cable plugged into the #1 port. Every drive followed in order from there. Windows assigned drive letters based on this ordering system. Partitions on each drive would just be assigned in order. Partition 1 on drive 1 is the C drive. Partition 2 on drive 1 is E. Partition 1 on drive 2 is F, and so on.
      My Computer


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 12:31.
Find Us

Windows 10 Forums