Art of BI: Windows Command Prompt Shorten Directory Length Trick

Developing and testing I use the windows command prompt quite a bit.

Often during testing my binaries and executables build folder is down a path off of the base root about five or more directories deep.  In the command prompt I have to run the common commands to CD (change directory), etc. before I land on the directory where I can then call my test programs.  The main problem with that is that my command prompt window often wraps around or just looks so busy that it irritates me.

I recently ran into a really cool solution that allows you to quickly shorten the command prompt entry line using the SUBST function.  It basically take a couple of parameters and maps an open drive letter for you based on the directory path that you supply.  The below is an example:

subst R:  “C:developmenttoolsprogrammingtestingproject1codetsfrunnablepathnodebin”

Simply take the above example’s syntax and modify it for your next testing episode.  The quotes around the directory path do not always need to be there, however, if you have a folder in that path that contains a space you will definitely need to use the double-quotes.

In the above example simply type SUBST and for the two parameters enter an open drive letter and then the directory path you wish to use.  Hit enter.

The cmd prompt will return cleanly.

Type R: and hit the return key.

Your prompt should return with the R: drive prompt and you can run your code from there.

Good Luck.

Contact Us
Christian Screen
Christian is an innovator in analytics and data warehousing design, best practices, and delivery. With more than fifteenyears of decision support and data warehousing with key experiences at Office Depot HQ, Sierra-Cedar, and Capgemini, he oversees the Oracle Analytics Practice which includes the technical development and delivery of Oracle BI collaboration software, data warehouse solutions, Oracle BI/EPM projects, and packaged analytics solutions at Datavail.

Leave a Reply

Your email address will not be published.
Required fields are marked (*).

8 thoughts on “Art of BI: Windows Command Prompt Shorten Directory Length Trick”
    1. at the prompt just type “C:” (no quotes), but this will move the prompt’s focus to the C drive. It’s not related to the tip that this post is discussing. Changing your directory is different than creating a sub-string directory.

  1. It seems a stretch to call this “business intelligence”, but it was exactly what I needed to know and several other searches just made things more confusing. Thanks!