Subst - Create Virtual Drives

  • From: "Wintips&Tricks" <wintips@xxxxxxxxxx>
  • To: "Wintips&Tricks" <wintips@xxxxxxxxxxxxx>
  • Date: Wed, 17 Mar 2004 12:49:23 -0500

March 17, 2004 - Issue 2

Archive tip (Updated)
Original post - Sun Nov 12, 2000

Create Virtual Drives Using the Subst Command
(applies to all versions of Windows)

Here's a Windows trick that's not that well known unless you know Dos.
Did you know you can create a virtual drive to any folder on your system?  For 
you can turn your Windows directory
into a W drive that will appear inside My Computer looking just like any other 
drive and
accessible just like any other drive.

You do this using the SUBST command which stands for substitute. It's easy.
Here's how you would create the example W: drive for the Windows folder:

Click Start>Run, enter this command:


and click OK


You now have a virtual W drive in My Computer that opens up Windows when 
doubled clicked
(go take a look)

You can access a virtual drive just like you would any other drive. For 
example, you can
simply enter W: in the Run box, at a
Dos prompt, in a bat file, or even shortcut to open up the Windows directory.

Another example:
Make a drive out of your Temporary Internet Files folder.
Just change the path in the example below to match your user name and the path 
to your own
Temporary Internet Files

SUBST T: "C:\Documents and Settings\YOUR USER NAME\Local Settings\Temporary 

(the quotation marks are essential)

This would give you a T: drive and allow you to access your  Temporary Internet 
Files by
simply entering T: in the Run box or at a
command prompt(or in  a shortcut even)
Not overy useful, I know, but could be handy if you ever need to access your 
TIF folder in
Dos since you don't have to type the
entire path or do any directory switching to get to it.

But if you do want to put this tip to use and keep the virtual drive intact, 
then there's
something else you need to do.
By default, the virtual drive will only last until you reboot. To keep it, you 
need to
have the command load at startup.
In Windows 9x, you can do this by placing thecommand in your autoexec file or 
for all
Windows versions,  in any bat file which you
can  then place in your Startup folder which you can access by right clicking 
the Start
button, choosing Open. You will find your
Startup folder in the Programs folder.

Here is how to create a simple bat file inside your Startup folder:
We'll use the letter W: assigned to C:\Windows, in this example.

Right click an empty area inside your Startup folder and click New>Text 
Open up the newly created notepad document and enter these commands

@echo off
subst W: C:\Windows

Save the txt file and then rename it with a .BAT extension.(click yes when 
asked to
confirm the name change)

Done.  Now, the bat file will load each time you startup to make sure the 
Virtual drive

Deleting a Virtual Drive

To delete a virtual drive, use the /d switch.
Example - to delete virtual drive W, you would enter:
in the Run box or at a command prompt.

but as stated, in Windows the drive only lasts until you reboot anyway so just 
the startup command to it should get rid of it as well.


Note - as some of you may know I also write for ABC and Techtrax. If you would 
like to
to either newsletter or both, you can do so at these links where you can also 
get more

As well, I run a magazine subscription service and am often asked to recommend  
Personally I prefer PC Magazine but I also like PC World and Maximum PC. These 
are the top

If you're also interested in the Registry, you may want to subscribe to 
Registry Answers.

If you have feedback, or a question or tip you would like to have considered for
submission, send it to::

If this was forwarded to you and you would like to subscribe to Wintips&Tricks 
go here:

To unsubscribe, click here and hit Send

Other related posts:

  • » Subst - Create Virtual Drives