Setting a drive letter to a directory in windows
In my work I work with different code branches and requires me to switch from one directory to the other. Wouldn't it be good if we could give a directory a drive letter of its own? The following batch code does just that.
#define the directory you want to assign a drive letter to
SET CURRENT_WORKDIR=C:\sourcecodes\theultimateapp1.0
#SET CURRENT_WORKDIR=C:\sourcecodes\theultimateapp2.0
#SET CURRENT_WORKDIR=C:\sourcecodes\theultimateapp3.0
#delete current assignment to the drive letter if there are any
SUBST z: /D
#assign the directory a drive letter
SUBST z: %CURRENT_WORKDIR%
I usually use just 1 drive letter, just commenting code if I want to switch from one to the other as needed. Type this in a text file, save this as a .bat file and run the batch file.
Now, you might want this behavior to persist every time you start your computer. Here's a very good resource to do just that.
http://www.freeweb.hu/wsh2/ch13e.html