Tuesday, May 17, 2005

Using "Subst" to Easily Access Folders with a Long Path

My fiance says that I'm a little OCD, that's medical speak for Obessive Compulsive Disorder. I don't actually believe her because finding the garden hose in my garage is impossible, but when it comes to my computer, I like to be organized.

I guess at a young age, when my first Computer Science teach, Mr. Rush, wanted me to keep my computer organized, we were required (for marks) to ensure our 3mb of space in our user directory was completely organized, and that was back when it was 8.3 filenames!

I guess starting there, I just got in the habit of organizing my files using directory structures. So what is this long winded approach for? Partly because I'm killing time before the 2nd half of my class starts, and partly to tell you how important I find the comand line ulility called "subst".

SUBST is actually pretty cool, it takes a fully qualified path and abstracts it out to a drive letter on the local machine. For me, I have a folder called C:\Documents and Settings\Sean\My Documents\My Pictures\Digital Camera\Favourites\RAW ... Phew, and I bet you had to take a breath just saying that path!

Well, simply crack open the command prompt and type:
subst P: {long winded fully qualified path}

Now you can simply change to your picture drive P: and view all the files from there and below. Makes it rather easy to access files doesn't it?


Anonymous said...

Very useful! But what happens when you no longer need the drive and you want to remove that drive... how would you do that?

Sean Daniel said...

Ah yes, you can use subst /? to get all the available commands, but to delete a drive you would use subst drive: /D