Map local Windows drive path to a drive letter from the command line

Contributor Icon Contributed by qmchenry Date Icon May 5, 2004  
Tag Icon Tagged: Windows

If a long path is frequently accessed, assigning it to a spare drive letter can save time. This recipe describes assigning a drive letter to a local drive path from the command line.


The subst command allows the substitution of a drive letter for a local drive path. For example, to map the drive C:\Documents and Settings\Quinn\My Documents to the drive Q: use the following command:

subst Q: "C:\Documents and Settings\Quinn\My Documents"

Once run, Q: should appear in the My Computer listing as a drive. Referencing a file in Q:\ will actually reference the file in the full path substituted above.

To review the existing drive substitutions, just run the command without any options:

subst

Previous recipe | Next recipe |
 
  • CPrU
    Thanks guys, so easy once you know how I can't believe it, I'm going to set up a whole lof of these now. Windows help doesn't help, surprise. This should be a menu feature in Windows. Run>Cmd>subst M: "M:My Files". Sweet.
  • Anonymous
    Har!

    Shouldn't this be in a category called "MSDOS"?

    Heck, subst may have been around since the days of CP/M.

    Not bashing, though; it's still a handy thing to know.
  • AlexTheBeast
    True. And in fact, many of the windows recipes are actually command line commands. They are organized under windows because most people don't run MS-DOS alone anymore.

    Ahhh... the old days when I would put F-10 Flight simulator in the A-Drive and boot-up into the game. Or using a boot disk to get my system as lean as possible for a great game of Doom.

    At least we now have the best of both worlds....
  • Anonymous
    8)
blog comments powered by Disqus