It is often very inconvenient to type long path names to move to a directory. Also sometimes code compilation fails if your command is taking more than certain length. In such cases, the base directory can be mapped to a Windows virtual drive so that the length of path can be reduced. For example “c:\mywork\myproject\release-10\” can be mapped to an unused drive “z:\“. Since then all files and directories present in “c:\mywork\myproject\release-10\” can be accessed using “z:\” as prefix.

Some old GNU compilation tools complain that command is too long when you have long pathnames and lot of command-line options. In such case, the pathname can be reduced using this technique.

Microsoft Windows supports a command “subst” which can be used to create a virtual drive.

c:\> subst z: c:\mydirectory
c:\> z:
z:\> dir