Create persistent substituted drives (subst) in Windows
Posted on June 16, 2009 at 5:50 am
Ever create a substituted drive in Windows before? If not, the SUBST command in Windows allows you to map a long path, such as C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\Outlook to a drive letter like Z:.
Whenever you click on the Z drive in My Computer, you will actually be pointing to the long folder path I mentioned above. Pretty sweet eh! This can be very useful on many occasions, especially when working with paths that are long than 256 characters.
So what’s the problem with using the SUBST command? It’s not persistent! That means when you restart the computer, your drive is gone. You have to create it again and you can’t have any startup program try to access the substituted drive since it’ll disappear.
psubst is a nifty little program that you can use to create persistent substituted drive in Windows that will remain even after restarting.
Creating a persistent virtual drive in Windows using pstub is very easy. Firstly, download and extract the executable file. Go ahead and drop the file into your C:\Windows\System32 folder so that you can run it from anywhere at the command prompt.
Once in place, go to the command prompt (Start, Run, CMD) and start creating virtual drives. The syntax for using psubst is as follows:
Create a disk:
psubst drive1: drive2:path
Delete a disk:
psubst drive1: /D
List of existing disks:
psubst
This will use the standard subst command to create virtual drives. If you wan to create a persistent one, just the /P argument as shown:
Create a persistent virtual drive:
psubst drive1: drive2:path /P
Delete a persistent virtual drive:
psubst drive1: /D /P
So to create a persistent virtual hard drive (Z) to the Outlook data folder I mentioned above, I would issue the following command:
psubst z: “C:\Documents and Settings\akishore\Local Settings\Application Data\Microsoft\Outlook” /P
Now your new drive will show up as a local disk in My Computer:
When you restart your computer, your drive will still be there. Not only that, but you can have other programs, such as services, etc, access the virtual drive even before Windows fully starts up because they drive will be available.
So check out psubst if you have certain long file paths that you access often and want easier access to! Enjoy!
» Filed Under Free Software Downloads
Related Posts
- How to create an "Invisible" hidden drive in Windows
- Convert your Windows computer into a virtual machine
- How to map a drive in Windows
- How to change the drive letter in Windows XP for an external USB stick or hard drive
- How to format external hard drive to FAT32 in Windows























Isn’t this like a shortcut? Like when you right click a folder and say create shortcut.
This is interesting, but you could go the much simpler route to get to locations having a long file path:
1. Right click the target folder.
2. Select “Send To”
3. Select “Desktop (Shortcut)”
4. Go to your Desktop and find the new shortcut.
5. Right click on it.
6. Select “Cut”.
7. Navigate to wherever you want the shortcut to go.
8. Right click and select “Paste”.
9. If you want to rename it, right click, select “Rename”, and type away.
^^
Exactly. I wrote the steps for the benefit of whoever reads this.
Anyway, a shortcut seems a lot easier than creating a persistent substituted drive. The point is easy access to your folder, right? I have a lot of folders categorized by different subjects and filled with shortcuts to the desired files. Say, I want my documents, videos, and web pages about programming in one place, but I want the videos to stay in the Videos folder, and I want my documents to stay in My Documents. What to do? Copying the whole vid, doc, etc., would be a waste of space, so I make send shortcuts of the stuff I need to the Programming folder I just made. The stuff stays put, but I can access all I need for programming by going to my new folder and using the shortcuts. Creating the persistant substituted drive is cool, really. But doesn’t seem to me to be the most efficient way to access files with long paths. Thanks anyway! ^^
Shortcuts probably don’t work with apps like P4.
It’s worked excellent for me so far, no matter what the processor.