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
-
Open Command Prompt:
- Press Win + R to open the Run dialog
- Type
cmdand press Enter (this opens the classic Command Prompt) - Alternatively, search for "Command Prompt" in the Start menu and select it
-
Check your current drive:
Type
dirand 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"). -
Switch to D drive:
Type
D:and press Enter. You should see a prompt likeD:\>(the backslash confirms the change). -
Verify the switch:
Type
diragain. If it shows files from D drive, the switch worked. -
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, thenlist 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
dirto 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
cmdwithpowershellin 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
exitto close Command Prompt after switching drives.
Troubleshooting
If the D drive isn’t available:
-
Check Disk Management:
- Press Win + R, type
diskmgmt.msc, and press Enter - Look for the D drive. If it’s marked "Offline," right-click it and select "Online."
- If it’s missing or unallocated, the drive may be faulty or not properly connected.
- Press Win + R, type
-
Verify drive letter assignment:
In Command Prompt, type
diskpart, then:list volume(lists all drives)select volume X(replace X with the correct number)assign letter=D(if needed)
- 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.
- Restart your PC: Sometimes drives simply need a reboot to reinitialize properly.
- 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).