Your Windows PC runs fine, but the operating system is loading from D: instead of the usual C:. This letter swap breaks file paths, disrupts software installations, and makes drive management confusing. This guide covers the exact steps to fix Windows booting from D drive instead of C drive.

Why Is Windows Booting from D Drive Instead of C Drive?
Windows normally assigns the letter C: to the primary boot partition. When another drive or partition claims C: before the OS loads, Windows takes the next available letter, which is usually D:.
Here is what usually causes it:
- Cloning a hard drive without stripping the old boot loader
- Installing a second copy of Windows on a different disk
- Manually changing drive letters inside a live Windows session
- A hidden System Reserved partition or an external USB with an active boot loader grabbing C:
- A Boot Configuration Database (BCD) that points to the Windows installation on D: while legacy boot files still sit on what should be C:
- BIOS or UEFI boot order change that promotes a secondary drive
How to Fix Windows Booting from D Drive Instead of C Drive
Work through the fixes below in order. Start with the registry swap if Windows still boots; jump to the BCD rebuild if the system fails to start at all.
Fix 1: Swap Drive Letters Using Registry Editor
The registry stores drive letter assignments under the MountedDevices key. Swapping the binary values for C: and D: while booted from recovery media forces Windows to treat the current D: volume as C: on the next boot.
Steps:
- Boot your PC from a Windows 11 installation USB.
- On the Install now screen, click Repair your computer > Troubleshoot > Command Prompt.
- Type
regeditand press Enter. - In Registry Editor, click HKEY_LOCAL_MACHINE, then go to File > Load Hive.
- Navigate to your Windows partition (run
diskpart>list volumein a second Command Prompt window to identify the correct drive letter in recovery). - Open
C:\Windows\System32\config\SYSTEM(the drive letter may differ in recovery). Name the hive OfflineSystem. - Go to
HKEY_LOCAL_MACHINE\OfflineSystem\MountedDevices. - Rename
\DosDevices\C:to\DosDevices\X:(a temporary placeholder). - Rename
\DosDevices\D:to\DosDevices\C:. - Rename
\DosDevices\X:to\DosDevices\D:. - Select the OfflineSystem key, click File > Unload Hive, close Registry Editor, and restart.
- Remove the USB drive and let Windows 11 boot normally.
Note: This fix works best when Windows already boots but lands on D:. If Windows does not boot at all, skip to Fix 3.
Fix 2: Reassign Drive Letters via Disk Management
If you have a second bootable Windows installation or a WinPE environment on another disk, you can reassign drive letters through the Disk Management GUI without editing the registry manually.
Steps:
- Boot from a Windows PE drive or a separate Windows installation on a different disk.
- Right-click Start and open Disk Management.
- Right-click the volume currently labeled D: (your actual Windows boot partition) and choose Change Drive Letter and Paths.
- Click Change and select C:. If C: is already in use, first remove the letter from the partition currently holding it.
- Right-click the partition that currently owns C: (often a small System Reserved or data partition) and assign it D: or another free letter.
- Restart the PC. Windows will now boot from C:.
Tip: Do not change the drive letter of your active Windows partition from within a live session on that same partition. Always perform this step from a secondary boot environment.
Fix 3: Rebuild the Boot Configuration Database (BCD)
The BCD tells the firmware where to find the Windows boot loader. When the osdevice and device parameters inside the BCD point to D:, rebuilding the database resets these entries to the correct partition. Windows then respects the default letter assignment on the next boot.
Steps:
- Boot from a Windows 11 installation USB and open Command Prompt (same path as Fix 1, Step 2).
- Run
diskpart, thenlist volumeto identify your Windows partition and note its current drive letter (for example, D:). - Type
exitto leave diskpart. - Back up the existing BCD:
bcdedit /export C:\bcd_backup- Remove the read-only, hidden, and system attributes from the BCD file. Adjust the drive letter to match your System Reserved partition (the one marked System in diskpart):
attrib C:\boot\bcd -s -h -r- Rename the old BCD file:
ren C:\boot\bcd bcd.old- Rebuild the BCD. When prompted to add Windows to the boot list, press Y:
bootrec /rebuildbcd- Fix the master boot record and boot sector:
bootrec /fixboot
bootrec /fixmbr- Restart the system. Windows should now boot from the correct partition and reassign C: to it automatically.
Warning: Run
bootrec /fixmbronly on MBR-based systems. On a UEFI system, skip that command and usebootrec /fixbootonly. Mixing commands on the wrong firmware type can make the drive unbootable.
Fix 4: Clean Install Windows 11 with Only the Target Drive Connected
Drive letter conflicts almost always appear when multiple disks or old boot partitions are present during installation. Disconnecting every other drive forces the Windows installer to see a single disk and create the boot and system partitions in their default layout, with C: as the system drive.
Use this fix when: other fixes failed, you do not need data on the target drive, or the drive layout is too tangled to untangle manually.
Steps:
- Back up any data you need from all connected drives.
- Shut down the PC and physically unplug every hard drive or SSD except the one where you want Windows installed.
- Insert a Windows 11 USB installer and boot from it.
- On the partition selection screen, delete all existing partitions on the target drive (select each partition and click Delete). Then click on the resulting unallocated space and click Next.
- Windows automatically creates the required partitions and assigns C: to the main OS volume.
- After installation finishes, shut down the PC, reconnect your other drives, and boot normally. The system drive is now C:.
A wrong boot drive letter is frustrating, but every cause has a direct fix. If Windows still loads but lands on D:, the registry swap in Fix 1 resolves it without touching the boot loader. If the system refuses to start, rebuild the BCD using Fix 3. Use the Disk Management route in Fix 2 when you have a second bootable environment handy and want to avoid registry edits. Reserve the clean install in Fix 4 for situations where the drive layout is too tangled to untangle or previous fixes did not hold. After applying any fix, verify the correct drive shows as C: in Disk Management before reconnecting additional drives.
FAQs
How do I switch from C: to D: in Command Prompt?
Open Command Prompt or PowerShell, type D:, and press Enter. Your working directory changes to D:. To also move into a specific folder on that drive, type cd \folder-name. To switch drive and folder in a single command, use cd /d D:\folder-name. This does not move system files; it only changes your active drive for file operations.
Can I rename C: to D: without reinstalling Windows?
You cannot safely rename the Windows boot partition from within a live session on that same drive. Attempting to do so through Disk Management while booted from the C: drive returns an error because Windows locks the active system volume. The only supported methods involve booting from recovery media and editing the registry MountedDevices key (see Fix 1) or rebuilding the BCD (see Fix 3). Both carry some risk, so back up your data before proceeding.
Why did Windows swap my C: and D: drives after reconnecting a backup clone?
When you reconnect a cloned drive, Windows sees two drives with identical boot signatures. The BIOS or UEFI boot order decides which disk initializes first, and the drive that initializes first gets C:. If your cloned backup drive initializes before your primary SSD, Windows boots from the clone and assigns it C:. Fix this by changing the boot order in BIOS to prioritize your SSD, then confirm the correct drive appears as C: after reboot.
