Saturday, August 31, 2013


Every once in a while you rediscover an old DOS command that, once remembered, you wonder why you haven't been using it more often.  I ran into this situation recently with what I considered to be a "bug" in a software vendor's installer package.  The instructions from the vendor said that to upgrade from version 2.x.x of their software to version 3.x, you should install the new v3.x to a temporary directory and then copy selected files over to the 2.x production directory.  Yeah, so this was a Linux application that had been ported over to Windows and there was no "upgrade" installation option.  Unfortunately, as I clicked on the .exe, the installer had a forced option for the directory to which it would install the program, which had I taken the defaults would have overwrote my production copy of the software, along with my data and custom settings.  What is a tech to do?  The easy thing would have been to simply done a "net use" and mapped a drive letter to one of my network server share directories and proceeded with the installation.  Would I ever do ANYTHING the easy way?  Of course not - because then I questioned "well, what if I didn't have a network server I could map to, then what would I do?"  So, I went to Windows Explorer and attempted to map a drive letter to a local directory via the GUI.  No dice.  Not an option.  Thus began my journey back to my DR DOS days and the SUBST command.

SUBST is a useful command line tool that allows you to map a drive letter to a local directory.



By using the SUBST command I was able to map a drive letter to a local directory, execute the software vendor's flawed Windows installer, and successfully copy the necessary files to upgrade my software from v2.x to v3.x.  In my case: c:\> subst p: c:\tmpdir1 was able to do the trick.

Never underestimate the power of and old DOS command to save the day.