Create a Virtual Drive of any Folder from Windows Command Prompt

A few days back, I talked about software that allows you to create a virtual drive of any folder i.e., like a folder on one of the partitions. It can create another drive, say Y, which appears on your computer. In this post, we will learn how you can create a virtual drive of any folder from the Windows Command Prompt.

Create Virtual Drives of your frequently accessed folders
Create Virtual Drives of your frequently accessed folders

The software name was Visual Subst, which made me thought if it was a windows command. I looked around, and yes, that was true. Subst is a dos command which allows you to create virtual drive out of any folder. Very handy for the most frequently accessed folders.

Subst Virtual Drive

Create Virtual Drive with Dos Command

Create a Virtual Drive of any Folder from Windows Command Prompt

Here is how the command works, and it’s options. You need to Associates a path with a drive letter.

SUBST [drive1: [drive2:] path]

SUBST drive1: /D

drive1: Specifies a virtual drive to which you want to assign a path.

[drive2:] path  Specifies a physical drive and path you want to assign to a virtual drive.

/D             Deletes a substituted (virtual) drive.

The Drive1 parameter must be within the range that is specified by the lastdrive command. If not, subst displays an error message.

Here is a sample command

subst z: b:\user\Ashish\forms

Instead of typing the full path, you can reach this directory by typing the letter of the virtual drive followed by a colon i.e., Z: from anywhere.

If you execute the SUBST command with no parameters, it will display a list of current virtual drives. It works on all Windows versions, including Windows 10, Windows XP, Windows Vista, Windows 7.

Do note that these are virtual drives, and commands like chkdsk, diskcomp, diskcopyformat, label, and recover will not work on them, and you should try it on these.

If you do not like to use the command prompt, Try the Visual Subst Tool


  1. What is the purpose of creating a virtual drive. You should explain that first

  2. Tried this repeatedly, MS DOS response is either ‘path not found’ or ‘incorrect number of parameters’.

  3. I remember using DOS to create a virtual drive in memory, so that a DVD could be loaded to memory and would play smoothly. Does the “subst” command do that? Or is there another command which isn’t listed when you simply type help to display all the commands?

  4. I looked it up, and all the SUBST command does is associate a path with a drive letter. It doesn’t create a virtual drive in memory. It’s only purpose is to make it easier to get to a long path name by using a drive letter.

    How do you make a virtual drive in memory? I have 2 gigs of memory, and the VOB files on my DVD’s are 1gig files that I won’t to simply copy to memory so they will play smoothly. I don’t understand why Windows Media Player won’t just load the DVD to memory itself, so I have to do it manually.


Please enter your comment!
Please enter your name here