To switch to the D drive in Command Prompt, simply type D: and press Enter. This changes the active directory to D without needing admin permissions or disk formatting—just type the drive letter followed by a colon.

What You'll Need

No special tools or preparation are required. You only need:

  • A Windows PC (all versions from XP to Windows 11)
  • Administrative access to the Command Prompt (for some advanced checks, but not the basic switch)
  • The D drive already assigned and accessible (if it’s not, see Troubleshooting below)

Step-by-Step

  1. Open Command Prompt:
    1. Press Win + R to open the Run dialog
    2. Type cmd and press Enter (this opens the classic Command Prompt)
    3. Alternatively, search for "Command Prompt" in the Start menu and select it
  2. Check your current drive: Type dir and press Enter. This shows the files in your active drive (likely C: by default). Note the drive letter listed (e.g., "Volume in drive C").
  3. Switch to D drive: Type D: and press Enter. You should see a prompt like D:\> (the backslash confirms the change).
  4. Verify the switch: Type dir again. If it shows files from D drive, the switch worked.
  5. Navigate to a folder (optional): To enter a specific folder on D drive, type cd "Folder Name" (e.g., cd Documents).

Common Mistakes

These errors happen most often—and how to fix them:

  • "D is not recognized": The drive isn’t assigned or isn’t visible in Windows. Check by typing diskpart, then list volume (requires admin).
  • "Access denied": The drive might be write-protected or locked. Right-click the drive in File Explorer, select Properties > Tools, then check for errors.
  • Command Prompt closes after switching: This usually means the drive is corrupted. Restart your PC or check for hardware issues.
  • Typing extra spaces or letters (e.g., "D: \"): The colon alone is the correct syntax—no trailing slash or space.

Tips

  • Use dir to confirm the switch—it shows files/folders in the active drive.
  • To return to C drive, type C: (or any other drive letter).
  • For PowerShell users: Replace cmd with powershell in Step 1, but the syntax is identical.
  • If D drive isn’t listed in File Explorer, it may be hidden or offline. Right-click This PC > Manage > Disk Management to check.
  • Use exit to close Command Prompt after switching drives.

Troubleshooting

If the D drive isn’t available:

  1. Check Disk Management:
    1. Press Win + R, type diskmgmt.msc, and press Enter
    2. Look for the D drive. If it’s marked "Offline," right-click it and select "Online."
    3. If it’s missing or unallocated, the drive may be faulty or not properly connected.
  2. Verify drive letter assignment: In Command Prompt, type diskpart, then:
    1. list volume (lists all drives)
    2. select volume X (replace X with the correct number)
    3. assign letter=D (if needed)
    Requires admin rights.
  3. Check external drives: If D is an external drive, ensure it’s plugged in and recognized by Windows. Go to File Explorer > This PC to confirm.
  4. Restart your PC: Sometimes drives simply need a reboot to reinitialize properly.
  5. Check for hardware issues: If D is a physical drive (e.g., internal SSD), listen for unusual noises or check BIOS (press F2, Del, or Esc during boot) to see if it’s detected.

Frequently Asked Questions

Can I switch to D drive in PowerShell?

Yes! The command is identical: type D: and press Enter. PowerShell and Command Prompt use the same syntax for basic drive switching.

Why does D drive disappear after switching?

This usually happens if the drive isn’t properly assigned or is corrupted. Run chkdsk D: /f (admin rights required) to check for errors.

How do I switch to a folder on D drive after switching drives?

Use the cd command followed by the folder name. For example, cd "Downloads" navigates to the Downloads folder on D drive.

Will switching drives delete my files?

No. Switching drives only changes the active directory—files remain intact. However, if you’re using commands like del without caution, you could accidentally delete files.

Can I use wildcards (e.g., D:*) to switch to D drive?

No. The correct syntax is simply D:. Wildcards are used for file operations, not drive switching.

How do I check if D drive is healthy?

Open Command Prompt (admin) and type chkdsk D: /scan. This runs a quick check for errors. For a full scan, use /f and reboot if prompted.

For advanced users, wmic logicaldisk get status lists drive health (but this won’t show detailed errors).