Mapping Drive Letters to Local Folders with subst
This is a nice time saver when working with various versions of Windows from the command line. If you have a folder that you access regularly and it lives deep within a hierarchy, you can assign it a drive letter. Sure you could use a shortcut in the GUI, but this tip shines when you’re using the command line.
Just enter the subst command at the command prompt, replacing the drive letter and folder with your own values.
subst x: C:\AppServ\custom\app\data\logs
I can now CD into X: for quick access. Make sure that you choose a drive letter that will not conflict with other drives. If you’d like it to persist across reboots, create a batch file and drop it in your Startup folder.
If you’re mapping network shares, look into the net use command. I’ve heard reports of bugs using subst however it has worked for me reliably on several systems.
Written by webmaster on November 12th, 2006 with no comments.
Read more articles on Articles.