Inserting a USB flash drive, opening an external hard drive, or launching executable installers in Windows 11 occasionally triggers an abrupt dialogue box: ‘The directory name is invalid’ (System Error 267). Double-clicking folder shortcuts fails, Command Prompt scripts abort, and File Explorer refuses to enumerate folder contents. In Windows NT operating system architecture, Error 267 indicates that a Win32 file system API (such as CreateDirectory or SetCurrentDirectory) received a path string where a directory was expected, but the path pointed to a file, an invalid drive letter, or an unmounted filesystem volume.
What Triggers Error 267 in Windows 11?
The invalid directory error originates from file path parsing breakdowns:
- Drive Letter Conflict or Missing Mount Point: An external USB or SD card assigned a drive letter that conflicts with an existing network mapping or virtual optical drive.
- Corrupted Temporary Directory Environment Variables: The system
%TEMP%or%TMP%environment variable pointing to a non-existent or inaccessible folder path. - Outdated or Corrupted USB Host Controller Drivers: USB hub controllers dropping packet synchronization during filesystem mounting.
- Damaged File System (Dirty Bit Set): Corrupted Master File Table (MFT) records on NTFS, exFAT, or FAT32 drives caused by abrupt removal without safe ejection.
Step 1: Assign a Fresh Drive Letter via Disk Management
Resolve drive letter collisions and restore clean volume mount points.
- Press Win + X and select Disk Management.
- Locate your external USB drive or partition in the lower pane.
- Right-click the partition and select Change Drive Letter and Paths.
- Click Change.
- Select Assign the following drive letter and choose a different letter higher up the alphabet (e.g.
M:,P:, orX:). - Click OK and confirm. Open File Explorer to verify access to the drive.
Step 2: Check and Repair File System via CHKDSK
Scan and repair filesystem metadata corruption preventing directory parsing.
- Press Win + S, type
cmd, right-click Command Prompt, and select Run as administrator. - Run CHKDSK on the affected drive letter (replace
X:with your drive letter):chkdsk X: /f /r - Allow the disk scan to complete verification passes and bad sector repairs.
- Once complete, attempt to open the directory again.
Step 3: Verify and Restore Default TEMP Environment Variables
If installer executables fail with Error 267, repair broken temporary paths.
- Press Win + R, type
sysdm.cpl, and press Enter to open System Properties. - Switch to the Advanced tab and click Environment Variables at the bottom.
- Under User variables for your user, check the values for TEMP and TMP.
- The default value should be:
%USERPROFILE%\AppData\Local\Temp - If either points to a missing drive or custom folder, click Edit and restore the default path. Click OK, reboot your PC, and re-run your application.
Step 4: Reinstall USB Host Controller Drivers
Flushing stale hardware communication stacks clears transient I/O controller errors.
- Press Win + X and open Device Manager.
- Expand the Universal Serial Bus controllers section.
- Right-click each USB Root Hub and select Uninstall device.
- Restart your computer; Windows will automatically reinstall clean USB root hub drivers during boot.