Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
    
i've never used subst myself, but this is what Wikipedia has to say on setting up a persistent mapping. hope it helps – Xantec Dec 2 '10 at 14:03
    
up vote 11 down vote accepted

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
share|improve this answer
    
+1. Still works in Windows Server 2012. Needs a restart. – Neolisk Jan 7 '14 at 18:50

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.

share|improve this answer
1  
I tried this, but it still didn't take. – Jim Fell Mar 23 '13 at 20:47
    
Did not believe this would work, but you were right! it worked i mapped my dropbox to Z: on the fly. well done – Mickey Perlstein Feb 8 '14 at 14:16
    
Does not work on Windows 10 – Starnuto di topo Mar 22 at 9:14
    
@Starnutoditopo, it works fine in Windows 10, assuming the cmd shell isn't elevated. – eryksun Jul 20 at 23:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .