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.
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.
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, diskcopy, format, 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