PC-Windows: WORKABLE/FIX IT Resolutions
Method 1. Change a USB port
When it reports a 'The directory name is invalid' error in Windows 11, the first thing you can try is to re-insert or replug the external hard drive, USB, or SD card via another port. Some users said changing the USB port solved the problem.
Method 2. Check Disk Errors
If this does not work, connect the device to another computer to check if can be opened or not. If the device can not be accessed, try to check and repair disk errors in Windows 11. Otherwise, it suggests that the 'the directory name is invalid' error has nothing to do with disk corruption and you have to try other ways to get the error fixed.
Method 3. Update Disk Driver
After ruling out the possibility that 'the directory name is invalid' error appears because of USB ports issue or disk errors, we can guess that the problem might stem from the disk driver. In this case, it is also recommended to try to update the disk driver and check if it helps.