Create a virtual drive

subst command allows to create a virtual drive for your desired folder which helps in quick and easy access to frequently accessed folders. For example, if you frequently use a folder "D:\portable\softwares", then you can create a virtual drive which will directly open this folder whenever you double click on it or access it from RUN or Command Prompt.
This feature is useful for deeply buried locations you use frequently as it offers quicker access.

To create a virtual drive open notepad and type:

DRIVE-LETTER with any unused drive letter followed by a colon : [A-Z]:
FOLDER-PATH with full-path of the folder you want to create virtual drive enclosed in double-quotes. For example:

SUBST X: "D:\portable\softwares"
Save this files as createDrive.bat
Make sure to select "All files" from save as type in save as dialog.
Double-click on this file to create virtual drive X:

Virtual drive created by subst command exists only for current session.
Copy this file to startup folder if you want this virtual drive to be automatically created each time you turn on your computer.

How to remove Virtual Drive?
Delete createDrive.bat file from startup folder and run the following command in command prompt:


For example, SUBST X: /D

/D parameter is used to un-mount a virtual drive.
You can view list of all existing virtual drives by subst command without any parameter in Command Prompt.

You cannot use existing drive letters for creating virtual drives.
You cannot use chkdsk, diskcomp, diskcopy, format, label and recover commands on virtual drives.

Post a Comment