Have you ever created a replacement drive in Windows before? Otherwise, the SUBST command on Windows maps a long file path to a drive letter.
For example, you can use this command to map the Outlook folder stored in C: Documents and Settings username Local Settings Application Data Microsoft Outlook to a drive letter such as Z.
Whenever you click the Z drive in My Computer, you will actually be redirected to the Outlook folder! This can be very useful in many different situations, especially when dealing with paths that are longer than 256 characters.
So what’s the problem with using the SUBST command? It’s not pushy! This means that when you restart your computer, your disk goes missing. You will have to create it again, and you have no way to force the launcher to try to access the replaced drive, as it will disappear.
psubst is a nifty little program that can be used to create a permanent replacement disk in Windows that will remain even after restart.
It is very easy to create a persistent virtual disk in Windows using psubst First, download the ZIP archive and extract the .BAT file. You can extract files on Windows simply by right-clicking the zip file and choosing Extract All.
Move the psubstbat file to the C: Windows System32 folder so you can run it from anywhere on the command line.
After that go to Command Prompt (Start, Run, CMD or just type CMD in the search box) and start creating virtual disks. The syntax for using psubst is as follows:
Create drive:
psubst drive1: drive2: path
Create disk:
psubst drive1: drive2: path
Remove drive:
psubst drive1: / D
Delete a disk:
psubst drive1: / D
List of existing drives:
List of existing disks:
psubst
This will use the standard subst command to create virtual disks. If you want to create a persistent, just provide the / P argument as shown:
Create a persistent virtual drive:
psubst drive1: drive2: path / P
Create a permanent virtual drive:
psubst drive1: drive2: path / P
Remove persistent virtual drive:
psubst drive1: / D / P
Delete a permanent virtual drive:
psubst drive1: / D / P
So, to create a persistent VHD (Z) for the Outlook data folder I mentioned above, I would run the following command:
psubst z: “C: Documents and Settings akishore Local Settings Application Data Microsoft Outlook “/ P
Your new drive will now appear as a local drive in My Computer:
Clicking the drive will take you directly to your Outlook folder. If you put files or folders on a drive letter, the data will be copied to the folder.
When you restart your computer, your drive will remain there. Not only that, but other programs such as services, etc., can access the virtual disk even before Windows is fully started as the disk will be available. It also appears wherever explorer is used such as Open, Save As, etc.
In general, mapping a folder to a drive letter is a great way to quickly and easily access a very deep folder. Obviously, you can also create a desktop shortcut to your folder, but the replaced drive method has the advantage of being accessible from any Windows dialog box that allows you to browse your computer. If you have any questions, do not hesitate to comment. Enjoy!
–