You're sitting at a client's computer—maybe a small accounting office—and they're trying to set up a virtual drive using SUBST in a batch file that runs at login. The script fails with error code 0X00000092. The exact message: "The path specified is being used in a substitute". This usually happens when someone (or another script) already mapped that same physical folder to a different drive letter using SUBST, or when the path itself is the target of another SUBST.
What's really going on here
Think of SUBST as a shortcut. It lets you take a long folder path like C:\Users\Public\Projects\ClientData and give it a drive letter like X:. But the system enforces a one-to-one rule: a specific physical path can only be the target of one SUBST mapping at a time. If you try to map C:\Users\Public\Projects\ClientData to Y: when it's already mapped to X:, Windows throws this error.
I had a client last month whose entire print queue kept breaking because a logon script was blindly running SUBST X: C:\SharedData without checking if X: already existed from another source. The script would error out, and then the network drive mappings got all scrambled.
The tricky part: SUBST mappings are per-user and session-specific. If you run SUBST in an elevated command prompt, it's a different session than your normal user. So a path that looks free in one window might be taken in another.
Step-by-step fix
- Open a command prompt as the same user who's seeing the error. Don't use "Run as Administrator" unless you need to, because that creates a different session.
- List all current SUBST drives by typing:
This shows you every virtual drive and the physical path it points to. Look for the path that's causing the conflict. If you see the same physical path listed under two different letters, that's your problem.SUBST - Remove the conflicting SUBST drive. If the path is currently mapped to drive Z: and you want to map it to Y:, first remove Z:
TheSUBST Z: /D/Dswitch deletes that virtual drive. Do this for any drive mapping that uses the same physical path. - Now create your new mapping. Example:
SUBST Y: C:\Users\Public\Projects\ClientData - Verify it worked by running
SUBSTagain. You should see your new mapping without the old one.
If it still fails
Check these three things:
- Is the path already in use by a regular drive mapping? Open File Explorer, right-click "This PC", and look under "Network locations" or "Devices and drives". If that exact folder path is mapped as a network drive (using
net useor the GUI), SUBST won't touch it. Remove the network drive first. - Are you running the command in the right context? If the error happens in a scheduled task or logon script, make sure the task runs with the same user account. SUBST mappings don't carry over between users.
- Could a third-party tool be using SUBST? Tools like
Visual SubstorImDiskmay create SUBST drives that aren't visible in a normal command prompt. Check their settings and disable any mapping that uses the same path.
If you've confirmed none of those, reboot the machine. SUBST mappings can get stuck in a weird state if a process crashes while holding one. A clean restart clears all session-level SUBST mappings, and you can start fresh.
One last thing: if you're writing a script that runs at startup, always remove any existing mapping for the drive letter before creating the new one. It prevents this exact headache:
SUBST X: /D 2>nul
SUBST X: C:\SomePath
That 2>nul hides any error if X: didn't exist in the first place. Keeps things clean.