Why is a subst drive usable from a command prompt but not Windows 7 explorer

17,090

Solution 1

This command creates a persistent Z: subst of C:\DirectoryName

reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices" /v Z: /t REG_SZ /d "\??\C:\DirectoryName" /f

Solution 2

This probably happens because the run command runs elevated (as administrator). If you run the subst command not elevated you will see it in Windows Explorer. You can test this running the subst on an elevated command prompt.

Solution 3

Use PSubst 3 utility. It is a DOS batch file that maps a drive permanently. Works in every windows version after XP.

Github Repository

Download latest version Direct link

Solution 4

https://github.com/ildar-shaimordanov/psubst

This is original repository of the psubst tool enabling SUBSTed drives be persistent between rebooting.

Share:
17,090

Related videos on Youtube

Dan
Author by

Dan

Updated on September 17, 2022

Comments

  • Dan
    Dan almost 2 years

    I have a registry key under [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run] The value of the key is

    "c:\windows\system32\cmd.exe" /c subst t: e:\MyFolder
    

    More often than not when I boot the computer the subst command appears to only half work. If I open a command prompt I can use t: fine. However if I look in windows explorer T: is not there and if I type it into the address bar I get an error message saying "Windows can't find 't:'. Check the spelling and try again."

    This is on Windows 7 Enterprise 64 bit.

    Any ideas?

    • Xantec
      Xantec over 13 years
      i've never used subst myself, but this is what Wikipedia has to say on setting up a persistent mapping. hope it helps
    • Pacerier
      Pacerier over 8 years
    • LawrenceC
      LawrenceC over 6 years
      There are so many layers of APIs and wrapper .DLLs in Windows that it's actually surprising when you make a change that is indeed visible everywhere. The command first appeared under DOS so that's it's "expected" environment.
  • Jim Fell
    Jim Fell over 11 years
    I tried this, but it still didn't take.
  • Victor Zakharov
    Victor Zakharov over 10 years
    +1. Still works in Windows Server 2012. Needs a restart.
  • Mickey Perlstein
    Mickey Perlstein over 10 years
    Did not believe this would work, but you were right! it worked i mapped my dropbox to Z: on the fly. well done
  • Starnuto di topo
    Starnuto di topo over 8 years
    Does not work on Windows 10
  • Eryk Sun
    Eryk Sun almost 8 years
    @Starnutoditopo, it works fine in Windows 10, assuming the cmd shell isn't elevated.
  • Julius Bullinger
    Julius Bullinger over 6 years
    It does not work on my Windows 10 machine with version 1607/build 14393. Can anyone confirm?
  • vic
    vic over 4 years
    Windows 2019 Server, still works, so Win10 should work, too. But because the setting is in HKLM, a reboot is required, a mere logoff is not enough.