First post, by pmennen
The CD command in modern versions of DOS have a /D option which also changes the current drive. So for example "CD /D F:\abc" would be equivalent to the two commands "CD F:\abc" and "F:".
Unfortunately for some reason DosBox doesn't implement the /D option for the CD command. I really need it however, or some other command or batch file that will do this in a single command. (The reason I need this is complicated but boils down to the fact that in a particular environment I have a string containing the path, but I don't have a separate string containing just the drive letter).
In searching for a solution, I found a very old dos utility called CWD which is the equivalent of CD /D. I'll use it if I have to but it has the significant drawback that it will not handle long file names like CD will.
One idea I had is too see if there was any utility that could extract the first 2 characters of a string argument. Suppose I found such a program (say called FRST2). Then I could make my wanted batch file as follows:
CD %1
FRST2 %1
Since the first two characters of the argument will always be the drive letter followed by a colon (in my situation) this would work for me.
Seems like there might be a function similar to FRST2 although so far I couldn't find one. Could something like that be built out of some batch scripting language?
Thanks in advance for any ideas you may have for me.
~Paul