On your computer there are probably just a handful of folders that you access everyday, and wouldn’t it be nice to make them even easier to access? One way to do that is to assign your most used folders to drive letters on your Windows machine, which puts them just a click away from your mouse. The good news is that Windows comes with the functionality needed to do this, but it’s buried in the command line.
If you’re new to using the command line in Windows you don’t have anything to worry about… this task will be about as easy as it gets. Being able to have your downloads folder, music, pictures, and more all assigned to different drive letters will definitely make this a well-spent two minutes.
–Assigning a Drive Letter to a Folder–
Note: If you’re familiar with how the command line works in Windows you can probably jump to the Command Prompt screenshot below to get the gist of what this section covers.
Open up the Command Prompt utility in Windows, which can be found in the Start Menu’s Accessories folder. Once the Command Prompt is open you’ll be able to start entering in commands. The format of the command you want to use is:
subst x: "c:\Documents and Settings\Wagner"
In that the “x:” represents the drive letter that you want to assign to the folder. You’ll get an error message if you try to use a drive letter that has already been assigned to another folder or one that is used by the operating system. The “c:\Documents and Settings\Wagner” is the directory on the computer that you want the drive letter to point to. Make sure you place quotes around the path to the folder if it contains spaces, otherwise it will not work.
To see a list of drive letters you’ve already assigned to folders just enter in
subst without any other parameters.
To remove a drive letter that you’ve assigned to a folder there are a few different things that you can do. If you don’t feel like diving back into the command line you can just log off or restart your computer. Alternatively this command can be used to remove a drive letter:
subst x: /d
In that command “x:” represents the drive letter you wish to remove, and the “/d” is what tells the computer to remove that drive letter.
Here’s a screenshot of the various different commands being used, and after the screenshot I walk through what each line is doing:
Here’s what’s going on in the screenshot:
- Assigning the Program Files folder to the X drive letter
- Assigning the My Documents folder to the Y drive letter
- Trying to assign the Windows folder to the Y drive letter, but it fails since I have already used it
- Using the
substcommand to list out the folders I currently have a drive letter assigned to
- Remove the X drive letter
- Show that the X drive letter has been removed
–Assign Drive Letters at Startup–
The only problem with the above system is that Windows forgets the folders you’ve mapped to drive letters once you log off or restart the computer. Luckily we can easily get around that by placing a customized batch file in your computer’s Startup folder. Here’s what you need to do:
- Open up Notepad, and list out each folder you want mapped using the
substcommand that we explained above. There should be one command per line, and make sure you put quotes around the path to the directory if it contains spaces:
- Now save this as a batch file. This can be done by going to File -> Save As, and enter in the name of your file. Make sure your filename ends in .bat:
- [Optional] You can test to make sure your batch file works as expected simply by double-clicking on it. The folders should be assigned the drive letters you specified in the batch file.
- Move the batch file you just created in the Start Menu -> Startup folder so that it runs each time your computer starts up.
That’s all there is to assigning drive letters to your favorite folders. It might seem a little complicated, but I wanted to be sure that you understood how everything works. If you’re still a little overwhelmed you can use a free app called Visual Subst that does essentially the same thing. The down side to the app is that it needs to run whenever your computer starts in order to assign the driver letters to the folders. So for the sake of performance I use the batch file method that I walked you through above.