How to fix Error 142 on Windows 11

Why This Error Happens

Error 142 occurs when the SUBST or JOIN command attempts to use a drive letter that is already active in a mapped network drive, an existing SUBST/JOIN session, or is otherwise locked by the Windows drive letter table. Windows 11 tracks virtual drive assignments in the registry and will reject any overlapping request to prevent data corruption. This is commonly triggered by leftover SUBST entries from a previous session that were not cleanly removed, or by third-party disk utilities holding a drive letter reservation.

Step-by-Step Resolution Guide

  1. Check for existing SUBST mappings
    Open Command Prompt as Administrator and run:
   subst

This lists all currently mapped virtual drives. Note any letter conflicting with the one you’re trying to assign.

  1. Remove the conflicting virtual drive
    If the drive letter is already in use, delete it before retrying:
   subst X: /D

Replace X: with the actual conflicting letter.

  1. Disconnect any active network drive using the same letter
    Go to File Explorer > This PC, right-click the mapped network drive, and select Disconnect. Alternatively, run:
   net use X: /delete
  1. Clear orphaned registry entries (if the error persists)
    Open regedit and navigate to:
   HKEY_CURRENT_USER\Network

Delete any subkey matching the problematic drive letter, then restart the PC to refresh Windows’ drive letter cache.

  1. Retry the SUBST or JOIN command
    Once the letter is free, reissue your original command:
   subst X: C:\YourFolderPath

Alternative or Verification Steps

  • Run subst again with no parameters — the drive letter should no longer appear unless you’ve successfully remapped it.
  • If the issue persists after a reboot, try assigning a completely unused drive letter (e.g., Z:) to confirm whether the original letter has a stuck OS-level reservation.