The directory name is invalid error on my SanDisk card

I’m having an issue with my memory card on Windows. When I try to access it, I get the error: “The directory name is invalid.”

Windows can detect the card and it appears in Disk Management, but the files are not accessible. So far I’ve tried:

Reconnecting the card / using a different card reader
Trying a different USB port and PC

No luck so far. How to fix the “The directory name is invalid” error?

@laineykk The directory name is invalid means Windows can’t find or access the folder path you’re trying to use.

Have you checked our knowledge base articles?
( Get Support for Your SSDs and Flash Products | Sandisk )

Try this one.

It is common to occur due to unsafe removal, sudden power loss, or a failing card. That message tells that the card’s file system is damaged. Windows can see the device, but it can’t read the folder structure. The good news is that the card is still detected.

Open Disk Management and check how the card appears. If it shows as RAW or unreadable, don’t try to format or repair it yet. Instead, run a recovery scan with a tool like Stellar Photo Recovery and save anything important to your computer.

Next, try formatting it in Windows using exFAT. If the normal format fails, use DiskPart to clean and recreate the partition.

That error usually means file system or directory corruption. Since Windows sees the card in Disk Management, don’t format it yet.

Try CHKDSK first:
chkdsk X: /f (replace X with the drive letter).
If it’s RAW or CHKDSK fails, recover the data with a recovery tool first, then reformat the card afterward.
This written guide might be helpful to fix this SanDisk SD card error.